feat(agent): track terminal turn outcomes - #2428
Draft
zhoum-hub wants to merge 2 commits into
Draft
Conversation
Signed-off-by: momo <[email protected]>
Signed-off-by: zhoum-hub <[email protected]>
6 tasks
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.
Summary
osoragent) on Agent create/send requestsagent.turn_completed,agent.turn_failed, andagent.turn_cancelledfrom canonical Host root-turn settlementsWhy
The local desktop did not have a stable, canonical event for whether a user-submitted Agent turn completed, failed, or was cancelled. The renderer knows the UI mode, while the daemon owns the authoritative terminal outcome; without durable submission provenance, choosing either producer alone would lose settlements or create
mode=nulldata.This change joins those facts by persisting submission-time mode and reporting only after the canonical Turn settlement commits.
Product impact
mode=osormode=agent; invalid or missing modes are skipped rather than guessedcompletedmeasures technical Turn completion, not whether the user's goal was semantically satisfiedstartup_reconciled=trueValidation
pnpm check:changed— 28 lanes passed after implementationpnpm check:changed -- --push-ready— 32 lanes passedPost-release DataFinder checks
modecontains onlyosandagent, with zeronullturn_idappears in at most one event across the three terminal eventsturn_origin=user_promptandis_child_session=false