Repository navigation
fix(chat): clear errors for a deleted project folder and Chat only's extension models (#1061, #804) - #1119
Open
agegr wants to merge 2 commits into
Open
fix(chat): clear errors for a deleted project folder and Chat only's extension models (#1061, #804)#1119agegr wants to merge 2 commits into
agegr wants to merge 2 commits into
Conversation
…ssage (#1061) A session whose cwd was deleted outside pi-web still starts its wrapper (selecting it opens the event stream), and a prompt then went on to the model, whose tools all fail there; pi's write tool would even recreate the folder. The pi CLI does not resume such a session. The wrapper now refuses the prompt with "Directory does not exist: <cwd>", the text /api/agent/new already answers for a fresh composer, and the composer keeps the draft. That answer never reached the user either: ensureNewSession() threw a bare "HTTP 400". It now passes the server's error on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chat only loads no extensions, so providers they register are missing from the session while the model selector's listing still offers them. Picking one failed with a bare "Model not found", a chosen model was silently replaced at start, and a session left with no model at all failed with pi's "No API key found". The session now names the model as an extension's that Chat only cannot load: set_model and a start with the chosen model refuse it, and a prompt in a session that could start on no model names the one it wanted. The composer shows the server's reason when creating the session fails. Chat only still loads no extensions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two cases where a send failed with a misleading error. Both share one client change:
ensureNewSession()threw a bareHTTP 4xx/500; it now shows the server'serrortext.#1061: prompt in a project folder deleted outside pi-web
Selecting such a session still starts its wrapper (the event stream does), and a prompt then went on to the model, whose tools all fail there (pi's
writewould even recreate the folder). The pi CLI refuses to resume such a session. The wrapper now refuses apromptwith "Directory does not exist: " (the text/api/agent/newalready answers for a fresh composer); the composer shows it as a notice and keeps the draft. Viewing the session and its event stream still work; no access check changed.Still as reported: the composer's "Model error: Directory does not exist…" (from
/api/models), and New/Send stay enabled for the missing folder (Send now gets the clear refusal). A real "folder missing" state that disables them needs a missing-vs-denied probe with its own authorization tests.#804: Chat only and models registered by extensions
Chat only loads no extensions (ADR 0002), so a provider an extension registers is missing from the session while the selector's listing still offers it. Picking one failed with a bare "Model not found", a model chosen in the composer was silently replaced at start, and a session left with no model failed with pi's "No API key found". All three now say
<provider>/<model> is provided by an extension, and Chat only loads no extensions. Choose another model or tool preset.Chat only still loads no extensions. The selector still lists extension models under Chat only (a per-preset model list would be a bigger change).Files:
lib/rpc-manager.ts,hooks/useAgentSession.ts,docs/agents/sessions.md,docs/agents/tools.md.Tests:
lib/rpc-manager-lifecycle.test.mjs(real wrapper, folder deleted, prompt refused, wrapper alive, file unchanged),lib/rpc-manager-chat-only.integration.test.mjs(fails without the fix),hooks/useAgentSession.test.mjs.tsc, eslint, fullnpm test(2680 pass).Closes #804
Refs #1061
🤖 Generated with Claude Code