Skip to content

feat(agent): add server-side cross-session agent tools (#275) - #294

Merged
kahme247 merged 1 commit into
mainfrom
fix/275-agent-tools
Oct 26, 2026
Merged

kahme247 merged 1 commit into
mainfrom
fix/275-agent-tools

Conversation

@kahme247

Copy link
Copy Markdown
Collaborator

Fixes #275

An agent inside omp-web can now reach other top-level sessions, which
omp's own task tool and write agent://<id> cannot do (they only work
inside one omp process). Three host tools, answered by the omp-web server
itself so they work with no browser tab open:

  • list_sessions — ID, name, cwd, running/idle for every session.
  • new_session — cwd (defaults to the caller's), prompt, model
    ("provider/modelId"), name; returns the new session ID, which appears
    in the sidebar like any other session.
  • send_to_session — sessionId, message, delivery (prompt/steer/followUp),
    wait. A non-running target is resumed first, as when a user opens it.
    With wait:true, the caller gets the target turn's final assistant text
    (default timeout 120s, capped at 300s).

Safety (all from the issue):

  • OFF by default. Enable "Agent tools (cross-session)" in Settings →
    System & Updates. It takes effect on the next host-tool registration
    (session start or SSE reconnect).
  • Every delivered message is prefixed in the target transcript with the
    sending session's full ID, so the origin is always visible.
  • Loop guard: 20 agent-tool calls per source session per minute, and a
    chain-depth cap of 5 (a delivery's target depth = source depth + 1);
    a failed delivery does not advance the chain.
  • Delivery rules are explicit: prompt only when idle, steer only when
    running, followUp in either state; anything else returns a clear error
    instead of corrupting a run. A waiter timeout never aborts the target.

Not in this PR (stated explicitly):

  • The issue's optional project allow-list is not implemented; the gate,
    rate limit, and chain-depth limit are the safety mechanisms here.
  • Verification is unit/fake-proc only (93 targeted tests pass, typecheck
    and lint clean); a live smoke test with a real omp child is still
    worth doing before merging.

Full suite: 1466 tests, 1455 pass, 6 fail, 5 skipped. The 6 failures
are the known pre-existing bin/omp-web-systemd.test.mjs PATH test plus
mcp-config/session-reader tests that reproduce on clean main and/or
pass in isolation (mcp-config alone gave 7/8 then 6/8 on successive
runs) — none of that code is touched by this patch, and the gate is
off by default in those tests.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c38fba3-4784-49f0-9f3d-c776c10fdd33
Commits

Reviewing files that changed from the base of the PR and between 1fa3d79 and 3b54e9c.

Files selected for processing: 9
  • app/api/web-settings/route.ts
  • components/SettingsConfig.tsx
  • lib/agent-tools.test.mjs
  • lib/agent-tools.ts
  • lib/i18n/locales/en.json
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts
  • lib/web-settings.test.mjs
  • lib/web-settings.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kahme247

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kahme247

Copy link
Copy Markdown
Collaborator Author

@kilocode-bot please review this pull request

@kilo-code-bot

kilo-code-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request.

@kahme247
kahme247 merged commit ab0dfce into main Oct 26, 2026
4 checks passed
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] Agent-callable tools to start a new session and to send a prompt to another session

1 participant