feat(flows): harness drivers for the new flow API - #77
Merged
Merged
Conversation
Grok Build's coganchor driver runs every rung the flow API may use at `--always-approve`, where the CLI approves for itself and never asks a client, so a PERMISSION_REQUEST hook on it would never fire. The coordinator authorised dropping the mixin from `GrokBuildAgent`, which `HARNESS_CAPABILITIES` is read from. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- `SessionBase.fork(into=, cwd=)` carries a conversation on as a conversation of another agent of the same backend and account, and into another directory where `forks_elsewhere` says the CLI can: Codex, Kimi Code and ZCode are told the child's directory, and Claude Code has its transcript copied to where `--resume` looks for it. - `SessionBase.cut(why=)` interrupts a turn and, on a backend whose transport is shared or whose runtime nothing reaches into (`cuts_transport`: Codex, Kimi Code, ZCode, dsh), puts that down, so that a turn or goal actually stops spending. - Codex: output schemas are held to what its structured outputs take (`strict`); an `approvals` override asks about every command while the rung's sandbox stays; a goal reports what it spends; and a thread first heard of on a server is counted from `last` rather than from its whole restored total. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`open_agent(spec)` builds an `AgentDriver` over coganchor for every `HarnessKind`, serving exactly `HARNESS_CAPABILITIES`. A session is a coganchor agent of its own, so that its rung, web access, skills, machine, hooks and questions are its own; turns run on threads of their own, with SESSION_START, USER_PROMPT_SUBMIT, STOP and SESSION_END fired on the loop and the CLI's own moments bridged through `HookBridge`. - Permission: local<=READ is the CLI's read-only rung, local=ALL is bypass everywhere; never a model-reviewed mode. Codex asks about every command (`untrusted`) while a PERMISSION_REQUEST hook is hung, Kimi Code and ZCode run at their asking rung while one is hung, and Codex's asking feature is switched on for an ASK_USER hook. - `/goal` goes to the harness's goal, steer maps to interject or to a cut and a new turn, forks carry on in another workdir where the CLI can, limits are held by the driver and usage is priced with `prices.cost`. - Failed turns come to the `HarnessError` leaf for their fault. - `open_outworlder(ask=, away=)` answers for whoever is outside the run. Tested against stand-in Claude Code, Codex and opencode CLIs through `check_agent_driver`, and against the real CLIs signed in here. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
futrime
pushed a commit
that referenced
this pull request
Sep 25, 2026
feat(flows): harness drivers for the new flow API
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.
Unit 3 (Wave 1):
open_agent(spec)andopen_outworlder(...)inhmz.runtime.flowing.harnesses. EveryHarnessKindgets anAgentDriverover coganchor that serves exactlyHARNESS_CAPABILITIES. The permission mapping and translation tables live inharnessing.py.Capability table changes
--always-approveand never asks.default_mode_request_user_inputfeature, verified with the real codex 0.153.4.Permission mapping
bypasseverywhere, so user and system scopes are not fenced.bypass.untrustedapprovals over its rung's sandbox;auto(also while an ASK_USER hook is hung).auto.coganchor changes
SessionBase.fork(into=, cwd=)withforks_elsewhere; Claude copies the transcript into the new workdir.SessionBase.cut()withcuts_transport.strict()output schemas, anapprovalsoverride, goal usage is now reported, and a thread resumed on a new server is counted fromlast.Tests
tests/unit/flows/test_harness_mapping.py.check_agent_driveragainst stand-in claude, codex and opencode, plus hooks, steer, forks, limits and faults, intests/integration/flows/test_harness_drivers.py.tests/system/agents/test_harness_drivers.py.🤖 Generated with Claude Code