Repository navigation
fix(core): explain session move failures - #56059
1052326311 wants to merge 2 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Verified: I ran the #56038 reproduction (simulated model, Code Mode session_move to a missing directory) from source. On the base the model gets Unable to move session to …. With this PR it gets Directory does not exist: …. The core tests closest to the change pass and packages/core type-checks.
The public API is unchanged. Only the model-facing tool description, system hint and error messages differ.
Two small points are inline: using catchTag keeps the error mapping checked by the compiler instead of falling through to Effect.die, and the reworded hint drops why to move the session.
Related: #55035
|
Updated at cb07d5f: session_move now calls the typed core Session service and maps its four declared errors with catchTag, so future error variants fail typecheck rather than falling into Effect.die. The worktree hint again says why to move the session and waits for creation to finish. Verified 20 core tests across tool-opencode and session-move, core typecheck, core build, scoped oxlint and Prettier, and git diff --check. The root aggregate check remains incomplete because the earlier ENOSPC install left stats-app without @solidjs/start; it has not been rerun. |
Issue for this PR
Closes #56038
Type of change
What does this PR do?
session_movenow reports the typed reason for a failed move to Code Mode, matching the existing HTTP messages. A missing worktree directory therefore tells the model what failed and can be retried after creation. The tool description and worktree hint say to wait for directory creation to finish. Unexpected failures remain defects.How did you verify your code works?
The new owner-level test failed on the original generic message and passed after the fix. It checks the model-facing result, two other typed failures, and a successful retry after creating the destination.
cd packages/core && bun run script/test.ts test/tool-opencode.test.ts test/session-move.test.ts(20 passed)cd packages/core && bun typecheckbun x prettier --checkandbun x oxlinton the three changed TypeScript filescd packages/core && bun run buildgit diff --checkRoot
bun run checkwas attempted but did not complete:@opencode/stats-app#typecheckcould not resolve@solidjs/startafter the dependency installation hitENOSPC.Screenshots / recordings
Not a UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #55035