-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(web-shell): expose assistant turn settlement lifecycle #11251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yiliang114
wants to merge
32
commits into
main
Choose a base branch
from
codex/issue-10389-turn-settlement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,549
−11
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ba3ee48
feat(web-shell): expose assistant turn settlement
yiliang114 d56d14b
Merge remote-tracking branch 'origin/main' into codex/issue-10389-tur…
yiliang114 544405b
fix(web-shell): harden turn settlement callback
yiliang114 dba5292
fix(web-shell): skip unused settlement observer
yiliang114 b8e2966
Merge remote-tracking branch 'origin/main' into codex/issue-10389-tur…
yiliang114 eefd8ad
fix(web-shell): correct turn settlement message and replay delivery
yiliang114 557f3e0
fix(web-shell): preserve turn settlement across reloads
yiliang114 bb506df
fix(web-shell): omit unsettled assistant message
yiliang114 00e04d7
fix(web-shell): retire abandoned prompts and pin turn-settlement gates
yiliang114 2a7d82f
Merge branch 'main' into codex/issue-10389-turn-settlement
yiliang114 246d9cb
fix(web-shell): keep turn settlement daemon-authoritative
yiliang114 698181e
docs(web-shell): document settlement deduplication
yiliang114 df28be5
fix(web-shell): prettier-format the WebShell README table after addin…
yiliang114 1e1f3e8
Merge origin/main into codex/issue-10389-turn-settlement
yiliang114 c03562b
fix(web-shell): define the split-pane active-prompt bridge mock in Ap…
yiliang114 bb2be28
fix(web-shell): retire destroyed-turn settlements at the abandonment …
yiliang114 faac643
test(web-shell): pin both streaming guards in the settlement projection
yiliang114 b946ccd
test(web-shell): a refused stale-session removal keeps the admission key
yiliang114 46b5e87
fix(web-shell): add retireAbandonedPrompt to the session-load and hea…
yiliang114 7298af7
test(web-shell): pin settlement verdicts and guard stale-session removal
yiliang114 2bd9a7c
style(web-shell): format assistant-turn-settlement design doc
yiliang114 0be25ba
test(web-shell): dedupe resync-then-replay settlement fixtures
yiliang114 0eab4a8
Merge origin/main into codex/issue-10389-turn-settlement
yiliang114 190e770
fix(web-shell): settle abandoned prompt ledger
yiliang114 980ee46
Merge branch 'main' into codex/issue-10389-turn-settlement
yiliang114 125fd1e
fix(web-shell): keep turn settlement daemon-authoritative
yiliang114 68df9b0
fix(web-shell): require whole-message ownership to settle a turn
yiliang114 a959c10
fix(web-shell): treat a finished unstamped assistant block as foreign
yiliang114 669d40e
fix(web-shell): settle a turn from its own final assistant block
yiliang114 febc864
Merge origin/main into codex/issue-10389-turn-settlement
yiliang114 77d8a56
fix(web-shell): strip insight frames from a settled turn's answer
yiliang114 64a996b
Merge origin/main into codex/issue-10389-turn-settlement
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
docs/design/web-shell/web-shell-assistant-turn-settlement.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Web Shell Assistant Turn Settlement | ||
|
|
||
| ## Problem | ||
|
|
||
| Embedding hosts currently infer turn completion from Web Shell's rendered | ||
| streaming state. That state is suitable for loading UI, but it does not identify | ||
| the daemon prompt or distinguish completion, cancellation, and failure. | ||
|
|
||
| ## Contract | ||
|
|
||
| `WebShellProps.onAssistantTurnSettled` reports: | ||
|
|
||
| - the session id and daemon prompt id; | ||
| - `completed`, `cancelled`, or `failed`; | ||
| - the daemon stop reason when present; | ||
| - the final retained top-level assistant message when available; | ||
| - error details for failed prompts. | ||
|
|
||
| The stable host idempotency key is `(sessionId, promptId)`. Existing | ||
| `onSessionChange({ type: 'turn_complete' })` behavior remains unchanged. | ||
|
|
||
| ## Delivery | ||
|
|
||
| Each mounted `DaemonSessionProvider` publishes every prompt terminal observed | ||
| on its live SSE stream after the terminal transcript projection is committed. | ||
| Hosts that need submitter ownership correlate the prompt id with their submit | ||
| result. On reconnect, a terminal carried only by the replay snapshot publishes | ||
| when this provider previously admitted that prompt. That admission gate keeps | ||
| ordinary persisted-history loading silent while surviving session switches and | ||
| epoch-reset reloads that discard the active request controller. | ||
|
|
||
| A lost connection or missing terminal does not publish a settlement: neither | ||
| condition proves how the prompt ended. Hosts receive only daemon terminal | ||
| events observed live or through reconnect replay. | ||
|
|
||
| The provider suppresses duplicate terminals for its mounted lifetime. A host | ||
| can mount the same session in more than one provider, such as the main chat and | ||
| a Split View pane, so durable cross-provider suppression remains the host's | ||
| responsibility through the documented idempotency key. | ||
|
|
||
| The final message is optional because bounded transcript retention, partial | ||
| history, cancellation, and failure can legitimately leave no retained assistant | ||
| text. Artifact and workspace projection have separate lifecycles and are not | ||
| implied to be settled by this callback. | ||
|
|
||
| ## Verification | ||
|
|
||
| - completed, cancelled, and failed live terminals publish once; | ||
| - subscribers observe the terminal transcript projection before the callback; | ||
| - duplicate terminals publish once per provider mount; | ||
| - persisted history load is silent while reconnect catch-up publishes, | ||
| including a terminal that arrives through the replay snapshot; | ||
| - main chat and Split View providers forward the callback; | ||
| - existing `onSessionChange` behavior is unchanged. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.