feat: give the omp assistant host tools to manage omp-web - #6
Merged
Conversation
Assistant-kind sessions now announce a management toolset to their agent via set_host_tools after spawn: list sessions, and create / stop / delete them. When the agent invokes one of these (host_tool_call), the manager intercepts the frame before it reaches clients or the replay buffer, runs it against its own registry/process management, and answers with host_tool_result. Guards prevent the assistant from deleting or stopping its own hosting session. The bundled mock RPC host now speaks the sub-protocol too: it records the announced toolset, announces registration as a notice, auto-invokes the first tool once (like an eager agent) and echoes results as notices — which the integration tests assert end-to-end. Wire shapes for host_tool_call/result follow the bridge's existing conventions; verify once against a real omp install before relying on the feature outside mock/dev. Docs: README notes the assistant's session-management abilities; roadmap item checked off. Server suite grows to 105 tests (+8 dispatcher unit tests +3 integration); line coverage holds at ~96.5% overall with new code at 96%.
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.
Delivers roadmap item 1 (plan recorded in #4).
What the assistant can now do
Assistant-kind sessions announce a management toolset to their agent right
after spawn (
set_host_tools):omp_web_list_sessions— every web session: name, status, cwd, id, kindomp_web_create_session— spawn a new coding session (cwd required; optionalname + initial prompt, which is delivered like any prompt)
omp_web_delete_session— stop and remove a session's dataomp_web_stop_session— stop an agent without deletingInvocations arrive as
host_tool_callframes; the SessionManager interceptsthem before clients or the replay buffer ever see them, runs them against
its own registry/process management, and answers with
host_tool_result.Guards refuse deleting/stopping the assistant's own hosting session.
Implementation notes
host-tools.ts) with a duck-typed managerso it stays unit-testable without processes.
toolset, announces registration as a notice, auto-invokes the first tool once
after setup (like an eager agent) and echoes results as notices.
host_tool_call/host_tool_resultfollow this bridge'sexisting conventions; verify once against a real omp install before relying
on the feature outside mock/dev environments.
Tests
paths, argument validation, self-deletion/self-stop protection, unknown tools
(no raw call frames reach clients), result answer delivery
Server suite: 91 → 105 tests; overall line coverage ~96.5%.
Docs: README features note the assistant's session-management abilities;
roadmap item checked off.