Repository navigation
fix(acp): restore the selected mode after an agent leaves it on its own #27665
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
base: main
Are you sure you want to change the base?
Changes from all commits
ed40a5a
945cb7a
710a964
6c4c040
1d0e554
acac83a
5689e51
fb53a55
866db49
6bb0e0a
25baf2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2798,10 +2798,25 @@ const handleSessionUpdate = | |
| ); | ||
| } | ||
| const parsed = parseSessionUpdateEvent(params); | ||
| if (parsed.modeId) { | ||
| const modeId = parsed.modeId; | ||
| if (modeId) { | ||
| yield* Ref.update(modeStateRef, (current) => | ||
| current === undefined ? current : updateModeState(current, parsed.modeId!), | ||
| current === undefined ? current : updateModeState(current, modeId), | ||
| ); | ||
| // A mode-only update would otherwise leave the mode option showing the old mode. | ||
| const configOptions = yield* SubscriptionRef.get(configOptionsRef); | ||
| const isStaleMode = (option: (typeof configOptions)[number]) => | ||
| option.category === "mode" && option.type === "select" && option.currentValue !== modeId; | ||
| if (configOptions.some(isStaleMode)) { | ||
| yield* SubscriptionRef.set( | ||
| configOptionsRef, | ||
| configOptions.map((option) => | ||
| option.category === "mode" && option.type === "select" | ||
| ? { ...option, currentValue: modeId } | ||
|
Comment on lines
+2814
to
+2815
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve values of other mode options. If a session has two
|
||
| : option, | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| for (const event of parsed.events) { | ||
| if (event._tag === "ToolCallUpdated") { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 8632
Script executed:
Repository: pingdotgg/t3code
Length of output: 29539
Script executed:
Repository: pingdotgg/t3code
Length of output: 25148
Script executed:
Repository: pingdotgg/t3code
Length of output: 43681
Script executed:
Repository: pingdotgg/t3code
Length of output: 7613
Script executed:
Repository: pingdotgg/t3code
Length of output: 14830
Script executed:
Repository: pingdotgg/t3code
Length of output: 4633
Script executed:
Repository: pingdotgg/t3code
Length of output: 1881
Route selection events to their originating run.
An older run can remain subscribed while background work continues. If it receives a later run’s selection event, it can attribute the update to the older run. A delayed duplicate can also overwrite a newer selection.
Include the originating run in the event and route it only to that run.