Repository navigation
feat(safari): steer follow-ups into a running turn and watch the session - #249
Merged
Merged
Conversation
A message sent while the session's turn is still running no longer waits for that turn to finish. `safari send` reads turn_in_flight from session/get and sets steering only then, so the running turn takes the message in at its next step and answers it; an idle session still runs the message as a turn of its own. The answer to a steered message comes from the running turn, under that turn's invocation, so `safari watch` now follows the session instead of one invocation: - --root-invocation-id marks where output starts (the request's first frame) and which request must settle before the watch can end; replies from every turn after that point are printed. - A turn that does not answer through the reply tool (one started from the web console) has its final answer, named by the settle's final_event_id, printed as a result reply. - A steered settle is written before the running turn answers, so it never ends the watch; the next non-steered settle with no standing tasks, followed by an idle session/get, does. - Re-arming with --root-invocation-id and --since replays the session from its start and skips everything up to the cursor silently, so the request's own settle is still seen. A done candidate inside the skipped part only ends the watch when nothing new follows it. Requires go-flashduty v0.16.1 for SessionMessageRequest.Steering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A follow-up sent while the session's turn is still running no longer waits for that turn to finish.
safari send: for an existing session it readsturn_in_flightfromsession/getand setssteeringonly then. The running turn takes the message in at its next step and answers it. An idle session still runs the message as a turn of its own, so its model input is unchanged.safari watchfollows the session, not one invocation: the answer to a steered message comes from the running turn, under that turn's invocation.--root-invocation-idmarks where output starts (the request's first frame) and which request must settle before the watch can end. Replies from every turn after that point are printed.final_event_id, printed as aresultreply.session/get, does.--root-invocation-idand--sincereplays the session from its start and skips everything up to the cursor silently, so the request's own settle is still seen. A done candidate inside the skipped part only ends the watch when nothing new follows it.Requires go-flashduty v0.16.1 (
SessionMessageRequest.Steering).Older CLI versions never send
steering, so their behaviour is unchanged.Tests
sleep 30steps):steered.make checkpasses (golangci-lint v2.11.4: 0 issues;go test -race ./...; build), as doesmake check-cards.