feat(server): /tool, /status, /exec endpoints#21777
Open
micuintus wants to merge 5 commits intoanomalyco:devfrom
Open
feat(server): /tool, /status, /exec endpoints#21777micuintus wants to merge 5 commits intoanomalyco:devfrom
micuintus wants to merge 5 commits intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
…alls from model context External tool parts are displayed in the TUI and persisted, but excluded from toModelMessages() to prevent orphaned tool_use/tool_result pairs. Plugins and HTTP endpoints can mark their tool executions as external.
… scripts Executes any registered OpenCode tool by name without LLM involvement. Results are streamed as plain text. When a messageID is provided, creates an external ToolPart so the execution is visible in the TUI. Introduces the emitter() and resolveModel() helpers shared by all plugin HTTP endpoints.
…e TUI Creates an external ToolPart tied to a parent message so plugins can surface status text in the TUI without sending content to the LLM.
b961e15 to
71d19bf
Compare
…ession Scripts can delegate decisions to the LLM by POSTing a prompt. A fresh child session is created for each call so token context never accumulates. Supports structured JSON output, file attachments, model override, custom system prompt, and live streaming. The parent session inherits the last-used model by default.
Adds create (POST) and bulk-update (PUT) routes for session todos. The new Todo.add() provides O(1) single-item insertion instead of the previous delete-all + insert-all pattern. Todo.update() is exported for the PUT bulk-replace route. Old todo routes (at the end of the chain) are replaced with improved versions placed after the GET route.
71d19bf to
2f5df54
Compare
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.
Issue for this PR
Closes #21771
Depends on #21772 (
externalflag on ToolPart)Type of change
What does this PR do?
Adds three server endpoints for plugin interaction with sessions:
external: trueso the model context builder skips it.This PR includes the
externalflag commit as a base. Once #21772 lands, this branch will be rebased to drop the duplicate.How did you verify your code works?
session-tool.test.ts,session-status.test.ts,session-naming.test.ts,session-todo.test.ts,emitter-type.test.tstool-part-visibility.test.tsbun turbo typecheckpassesScreenshots / recordings
No UI changes.
Checklist
Part of the plugin primitives work split from #21687 (tracking issue #20018).