Skip to content

feat(protocol): add run --bridge and sessions --show for out-of-process hosts - #192

Merged
fuseraft merged 4 commits into
mainfrom
feature/run-bridge
Oct 31, 2026
Merged

fuseraft merged 4 commits into
mainfrom
feature/run-bridge

Conversation

@fuseraft

Copy link
Copy Markdown
Owner

Stacked on #190 — retarget to main before merging #190.

What

  • fuseraft run --bridge: runs one orchestration session as a JSONL process for an out-of-process host (fuseraft-server). Emits ready (with protocolVersion), agent_starting, tool_calling, token_budget_warning, agent_message, and a final result; reads approval_response and interrupt on stdin.
    • Builds with HITL gating like serve, so shell commands, file writes, tool actions and route handoffs (route_approval, new) are approved by the host.
    • Rejects --hitl (there's no terminal to pause on) with a result event rather than hanging.
  • fuseraft sessions --show <id>: prints a session's messages; with --json, returns it in an item envelope (SessionDetail / AgentMessage wire records).
  • Fix: sessions --show and sessions --delete crashed on a malformed id (the store throws ArgumentException); both now report "not found". The --delete crash predates this branch.

All additive: no existing event, field or text output changes, so the VS Code extension is unaffected.

Docs

docs/protocol.md covers the run bridge transport, its events, and the new records; docs/cli-reference.md lists --bridge and --show.

Testing

  • Unit tests for sessions --show/--delete and route approvals over the JSON bridge; full suite passes.
  • Live against a real model (isolated FUSERAFT_HOME): approve and deny of file writes and shell commands, interrupt then --resume, bad config, and --hitl rejection.
  • End to end through the rewritten fuseraft-server (fuseraft/fuseraft-server, feature/out-of-process).

- fuseraft-server linked the CLI's assemblies and broke on every internal refactor; clients now get a documented JSON contract instead
- Wire records are separate from internal types and pinned by tests, so reshaping a model can't silently change what clients parse
- --json on sessions (plus --repl for chats), memory/context/schedule list, plugins and models; human output is unchanged
- protocolVersion on the bridge's ready event and a hello handshake on the serve socket let clients detect breaking changes
- docs/protocol.md replaces the stale bridge table in cli-reference.md
- YamlDotNet wrote DateTimeOffset as a property-bag mapping it couldn't read back, so NextRun always loaded as default and schedule run ran every job on every invocation
- Timestamps are now one ISO 8601 UTC scalar, matching the format docs/cli-reference.md already shows
- Job files written by older versions are still read (utc_ticks, falling back to utc_date_time) and are rewritten in the new format after their next run
…ss hosts

- fuseraft-server needs to drive an orchestration session without linking
  CLI internals; run --bridge streams ready/agent_message/tool_calling/result
  JSONL and reads approval_response/interrupt on stdin
- Bridge builds with HITL gating like serve, so shell, file and tool actions
  plus route handoffs are approved by the host instead of auto-running
- sessions --show <id> (--json) returns a session's full message history so
  hosts can render past sessions started from the terminal
- sessions --show/--delete crashed on a malformed id; now reports not found
@fuseraft
fuseraft merged commit ab52f33 into main Oct 31, 2026
9 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.

1 participant