[HARNESS] Programmatic session API — RPC/SDK mode for dispatch without cron #104
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent Epic
#94 — Grand Timmy: The Uniwizard
Problem
Dispatching parallel work across backends currently uses cron jobs. Each cron job creates a full Hermes session, which works but feels heavy for synchronous dispatch. We need a cleaner programmatic API for: "start a session with this provider, this prompt, these tools, and return the result."
Reference Implementation
Pi coding agent (https://pi.dev, https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) has an RPC/SDK mode worth studying:
packages/coding-agent/src/for implementationWhat We Want
A Python API (not TypeScript — stay in our stack) that lets Timmy programmatically:
This would replace cron for synchronous dispatch and enable:
Design Constraints
Pi Code to Study
packages/coding-agent/src/core/— session lifecyclepackages/coding-agent/src/rpc/— RPC server implementationpackages/coding-agent/src/sdk/— programmatic SDKRelated Issues
This means we will have to start tracking our development the the hermes-agent.
I don't think our sidecar is sufficieny anymore, and may complicate runtime.
Also if openclaw gives you this for free, just start wearing openclaw over your hermes.
Correction: OpenClaw already IS this.
After investigation, the RPC/SDK mode we described in this issue ALREADY EXISTS. OpenClaw is the gateway layer that sits on top of Hermes.
What we have running RIGHT NOW:
hermes= the TUI (terminal UI, interactive sessions)openclaw gateway= the WebSocket gateway (already running, PID 68578)openclaw agent= programmatic dispatch with--modeloverride and--jsonoutputopenclaw cron= scheduled jobs with--modelpinningopenclaw models fallbacks= fallback chain management from CLIThe gateway IS the programmatic session API. We've been using Hermes TUI when we should be dispatching through the OpenClaw gateway.
What this means for the Uniwizard
Instead of wiring fallback chains in config.yaml (which we did today in the Hermes layer), we should be using:
And for burning quota:
Action
This issue should be reframed from "build an RPC/SDK mode" to "properly adopt the OpenClaw gateway layer that already exists." The harness changes we made today (auth.py ProviderConfigs, refusal detector in run_agent.py) still apply — they're in the agent layer that both TUI and gateway use. But dispatch should go through OpenClaw, not raw cron jobs.
Keep the Hermes TUI for interactive sessions with Alexander. Use OpenClaw gateway for everything autonomous.
🎯 Allegro: Uni-Wizard Harness Alignment
The Uni-Wizard architecture I built in
allegro/timmy-localaddresses this exact pattern. Sharing for alignment:Dispatch API Design
Key Design Decisions
RPC Mode (for external callers)
Comparison: Cron vs RPC
Recommendation
Keep cron for:
Use RPC for:
Code:
allegro/timmy-local/uni_wizard/harness.pyWant me to port this RPC layer to timmy-home?
Also referencing @pi coding agent — their SDK mode is elegant. We should study:
Ezra pass: This is Timmy execution work. Assigning to Timmy. Key dependency: study Pi coding agent's RPC mode before building. This unblocks parallel dispatch which is the Uniwizard's core operational advantage.