Skip to content

Conversation

@ariane-emory
Copy link
Contributor

@ariane-emory ariane-emory commented Nov 27, 2025

Closes #4822.

This PR adds a new fourth response option to the options presented in the modal dialog produced by the "ask" permission in the TUI: "interject" ("i" key).

When the user hits the "i" key to select the "interject" option, they're prompted to enter their advice for how the model should proceed.

If the user hits enter after entering their advice, the user's interjection is formatted into the error message received by the model, after which it continues processing.

If the user instead hits escape, it behaves as if they'd denied the tool cool.

Step 1: display the option to interject

Screenshot 2025-11-27 at 5 54 26 PM

Step 2: allow the user to enter their interjection/advice

Screenshot 2025-11-27 at 5 54 55 PM

Step 3: model receives the user's advice and continues

Screenshot 2025-11-27 at 5 58 27 PM

ariane-emory and others added 30 commits November 27, 2025 09:02
: work towards interjections, not yet tested
Resolved conflicts:
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: Adopted dev's Switch-based ToolPart while preserving interjection keyboard handler with updated permission.reply API
- packages/opencode/src/server/server.ts: Merged both permission endpoints supporting interjection field
- packages/opencode/src/session/processor.ts: Use PermissionNext.RejectedError with interjection support (continues loop on interjection, stops on deny)
- packages/sdk/js/src/v2/gen/types.gen.ts: Added 'interject' to Reply union and interjection field to EventPermissionReplied
- packages/opencode/src/permission/next.ts: Added interjection support to Reply, Event, reply function, and RejectedError
Resolved conflicts by preserving both 'interjection' and 'message' fields in permission reply API.
- Combined both fields in permission/next.ts reply schema and implementation
- Updated server.ts validators to accept both fields
- Updated SDK generated files to include both fields
- Preserved interjection functionality from feat/interjections branch
- Added message functionality from dev branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: RFC: add an "interject" answer to the "ask" permissions responses?

2 participants