fix(acp): send session setup updates after new and fork session responses - #11018
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5104940135
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| responder.respond(response)?; | ||
| if let Err(error) = agent | ||
| .notify_session_setup_by_id(&cx_clone, &session_id) | ||
| .await |
There was a problem hiding this comment.
Queue setup updates before accepting follow-up requests
Once respond is called, the client can immediately submit session/prompt, but the setup task then yields while reloading the session and usage totals. Because prompt handling is spawned concurrently, its final usage update can be sent before this task resumes, after which the older setup usage update resets the client's counters; the same race exists in the fork handler. Gather the setup state before responding, then synchronously enqueue the response followed by its notifications so no follow-up request can interleave them.
Useful? React with 👍 / 👎.
DOsinga
left a comment
There was a problem hiding this comment.
The final commit addresses the notification-ordering race by preparing session setup state before responding, then enqueueing the response and setup notifications without yielding. The raw ACP tests cover the required ordering for both new and forked sessions, and all required checks pass. This is a clear, contained core-team bug fix. LGTM.
* origin/main: fix(streaming): skip metadata-only SSE frames instead of failing the turn (#10942) fix(telegram): send responses as rich markdown (#11062) fix(acp): send session setup updates after new and fork session responses (#11018) fix(ui): remove duplicated brace-expansion keys that break every pnpm install (#11071) # Conflicts: # ui/pnpm-lock.yaml
* main: fix(streaming): skip metadata-only SSE frames instead of failing the turn (#10942) fix(telegram): send responses as rich markdown (#11062) fix(acp): send session setup updates after new and fork session responses (#11018) fix(ui): remove duplicated brace-expansion keys that break every pnpm install (#11071) chore(deps): bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.2 (#11037) chore(deps): bump actions/setup-java from 5.6.0 to 5.7.0 (#11036) chore(deps): bump Jimver/cuda-toolkit from 0.2.35 to 0.2.36 (#11035) chore(deps-dev): bump js-yaml from 4.3.0 to 4.3.1 in /documentation (#11052) chore(deps-dev): bump @types/yauzl from 2.10.3 to 3.4.0 in /ui (#10975) chore(deps-dev): bump electron from 41.0.0 to 41.10.3 in /ui (#10969) chore(deps): bump brace-expansion from 1.1.16 to 1.1.18 in /documentation (#10947) chore(deps-dev): bump postcss from 8.5.8 to 8.5.23 in /ui (#10946) chore(deps): bump aiohttp from 3.14.1 to 3.14.3 in /scripts/provider-error-proxy (#10945) chore(deps): bump fast-uri from 3.1.4 to 3.1.5 in /documentation (#10944) fix: reject invalid subrecipe content (#10994) chore(deps): bump azure/login from 3.0.0 to 3.0.1 (#11033) chore(deps): bump pnpm/action-setup from 6.0.9 to 6.0.10 (#11034) Cache-safe request assembly: append-only turn context and declared cache semantics (#11022)
* main: docs: add tool shim guide covering when to enable, backends, and troubleshooting (aaif-goose#10858) fix(deep-link): route extension/session deep links to regular windows not standalone app windows (aaif-goose#10908) fix(ui): raise chat input z-index so slash menu appears above loading indicator (aaif-goose#11015) fix(ui): support remote working directory for external backend (aaif-goose#10827) fix(acp): resume provider-native sessions (aaif-goose#10379) fix (UI): Fix Form/JSON toggle buttons invisible in dark mode on Deeplink Generator (aaif-goose#11077) fix(streaming): skip metadata-only SSE frames instead of failing the turn (aaif-goose#10942) fix(telegram): send responses as rich markdown (aaif-goose#11062) fix(acp): send session setup updates after new and fork session responses (aaif-goose#11018) fix(ui): remove duplicated brace-expansion keys that break every pnpm install (aaif-goose#11071)
Summary
Fix #11010
Change
Send ACP setup notifications after
session/newandsession/forkresponses instead of before responses are completed. This aligns slash-command advertisement (include usage) with ACP standard in the post session creation flow.Testing
/goalis sent throughsession/prompt