refactor: goose 2 ui used acp session id - #8985
Conversation
* main: remove artifacts dir handling (#8945)
* main: align extensions page styling (#9003) fix: SACP notifies clients of generated session names (#8983) replace artifact heuristics/regexes with protocol messages (#8996) fold UI refactor review into code review skill (#8982) Improvements to LM Studio declarative provider (#8973) chore(deps): bump dawidd6/action-download-artifact from 12 to 21 (#8959) chore(deps): bump azure/login from 2.3.0 to 3.0.0 (#8957) chore(deps): bump actions/github-script from 8.0.0 to 9.0.0 (#8956) chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 3.1.0 (#8955) Fix CRT linkage in Windows CUDA build (#8987) # Conflicts: # ui/goose2/src/features/chat/stores/chatSessionStore.ts # ui/goose2/src/shared/api/acpNotificationHandler.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7be66f746b
ℹ️ 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".
| const response = (await client.extMethod("_goose/tool/call", { | ||
| sessionId: acpSessionId, | ||
| sessionId: payload.sessionId, | ||
| name: `${payload.tool.extensionName}__${name}`, |
There was a problem hiding this comment.
Preserve legacy MCP payload session fallback
McpAppView now always sends payload.sessionId to _goose/tool/call and GooseResourceRead, but older stored MCP-app message payloads can carry a UI/local session id in sessionId and the ACP id in gooseSessionId (the fallback that was just removed). In that upgrade scenario, MCP app actions from historical conversations will call the backend with a non-existent session id and fail at runtime. Keep a backward-compatible fallback (payload.gooseSessionId ?? payload.sessionId) or add a migration when hydrating old message payloads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I don’t think we should keep the fallback here because after this refactor payload.sessionId is the ACP session id, and replayed MCP app payloads are rebuilt from ACP notifications with that id.
Resolves conflicts from PR #8985 (refactor: goose 2 ui used acp session id, de471bc), which collapses the local/goose dual-session-id model into a single canonical ACP sessionId. - ui/goose2/src/shared/api/acpNotificationHandler.ts: drop acpSessionTracker imports in favor of handleSessionInfoUpdate from acpSessionInfoUpdate; keep our getToolChainSummary import; preserve our findLiveMessageIdWithToolCall(...) ?? ensureLiveAssistantMessage fallback in tool_call_update while dropping the now-removed gooseSessionId arg. - ui/goose2/src/shared/api/acpNotificationHandler.test.ts: take main's reduced content (just the renamed "applies usage updates to the ACP session id" test). Our chain-summary tests moved to the consolidated __tests__/ file. - ui/goose2/src/shared/api/__tests__/acpNotificationHandler.test.ts: migrate the auto-merged P1 regression test from registerSession(...) to registerPreparedSession("acp-session", ...) and unify session ids; move the three chain-summary tests (live x2, replay x1) from the legacy file with the same migration; switch the replay assertion to getReplayBuffer(...) since replay messages live in the replay buffer rather than messagesBySession. Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Pulls 40 new commits from main, including: - #8945 remove artifacts dir handling (lines up with our /artifacts cwd fix) - #9000 replace raw config and secret methods - #9008 remove skill categories - #9019 fix small-window chat & settings layouts - #9023 ACP child reap fix - #8911 goose2 distribution bundling - #8983 SACP session-name notifications - #8985 use ACP session id in goose2 UI - #8995 group consecutive tool calls into chain card - #8996 protocol artifact messages (replace heuristics/regexes) - #8999 elicitation fixes - #9000 plus follow-ups for config/secret ACP methods - many smaller changes across CI workflows, AGENTS docs, deps Conflicts resolved: - src-tauri/src/commands/projects.rs: kept our delete (we moved projects to ACP); main had unrelated edits. - src-tauri/src/lib.rs: dropped projects::* command registrations, kept main's get_goose_serve_host_info addition. - check-file-sizes.mjs: accepted main's deletion (#8996 removed it). - features/projects/api/projects.ts: kept our ACP-based rewrite (ProjectInfo without createdAt/updatedAt; uniqueProjectSlug for collision avoidance). - features/projects/lib/chatProjectContext.ts: took main's rename resolveProjectArtifactRoots → resolveProjectRoots and dropped /artifacts segment append (we already had this fix); dropped buildProjectSystemPrompt (backend's load_project_instructions handles project system prompt injection now). - features/projects/lib/sessionCwdSelection.ts: took main's no-project fallback ['~'] (matches our /artifacts removal in the project branch). - features/chat/hooks/useChatSessionController.ts: took main's 3-arg acpPrepareSession (the personaId/projectId we'd been passing were never read on that call path; newSession sends them via _meta). - ProjectInfo test fixtures: dropped createdAt/updatedAt across CreateProjectDialog.test.tsx and sessionCwdSelection.test.ts. - chatProjectContext.test.ts: dropped buildProjectSystemPrompt test.
Summary
Simplify goose2 ACP session handling so the UI uses the ACP session id as the single canonical session id.
Previously the UI carried its own session id and relied on a tracker to map that id to the real ACP session id, including persona-specific lookup keys. That made session creation, replay, notification routing, cancellation, and tests harder to reason about.
This change removes that indirection. New sessions now use the
sessionIdreturned by ACP directly, and existing sessions are prepared/loaded by that same id.Behavior Change
The only intended behavior change is that
prepareSession()no longer silently creates a replacement ACP session when the provided session id cannot be loaded.Existing flows should create sessions through
acpCreateSession()first, then prepare/load that ACP session id. If the UI has a stale or corrupt session id, it will now fail instead of being replaced behind the UI’s back.Other session behaviors are intended to stay the same; this refactor only removes the extra UI-to-ACP id indirection.
Testing
Unit tests and manual testing