Skip to content

feat(v2): streaming-aware benchagi CLI (V1.0-beta)#1

Merged
LightDriverCS merged 2 commits into
mainfrom
feat/v2-streaming-cli
May 6, 2026
Merged

feat(v2): streaming-aware benchagi CLI (V1.0-beta)#1
LightDriverCS merged 2 commits into
mainfrom
feat/v2-streaming-cli

Conversation

@LightDriverCS

Copy link
Copy Markdown
Contributor

Summary

Drops the V2 streaming-aware benchagi CLI built across the 2026-05-05 session. The legacy bench wrapper stays in place. Includes Phase 1 spec, six ADRs, and the full impl that verified live against brew openclaw 2026.5.2.

What's in V1.0-beta:

  • WebSocket transport against local OpenClaw gateway (protocol v3 negotiation, full method validation)
  • Event router with taxonomy unwrap + dedupe (LRU)
  • Two-clock liveness (run-quiet + gateway-tick) with reconnect/active-run scoping deferred to V1.1
  • Multi-line REPL with history
  • Approval state machine (exec / plugin)
  • Firebase Direct auth scaffold (browser-to-loopback per ADR-002)
  • Doctor probe with full method validation
  • Capability probe (model heuristic + override semantics per ADR-005)
  • Short-name agent resolution
  • 34 unit tests across 5 files (probe, event-router, liveness, agents, state) — all green

Includes test-runner fix: dropped the dead --import tsx loader from the test:v2 script. Compiled .test.js files import only .js, never .ts, so the tsx loader was never reachable. With this fix, npm run test:v2 runs the suite directly via node --test.

Verified live: benchagi doctor, benchagi agents list, benchagi --agent <name> "ping", REPL multi-line input — all confirmed end-to-end against brew openclaw 2026.5.2 on the dev mac.

Hammer-Anvil receipts:

  • ANVIL 2 (spec) — revise-then-ship → all P0/P1 addressed
  • ANVIL 3 (impl) — hold → P0 + 2 P1s landed pre-tag; remaining 4 P1s tracked in docs/v2/ACTION-PLAN.md
  • Next: ANVIL 4 (cloud-brain readiness, post W1+W4 merges), ANVIL 5 (cloud-brain end-to-end smoke)

V1.1 follow-ups (reconnect, active-run liveness, REPL approval keys, tool error detail, [r] expand, port retry) are queued as separate Hammer-Anvil cycles per the ~/.openclaw/wiki/main/_boards/runbooks/platform/benchagi-v2-cloud-brain-pickup.md runbook.

Anvil Handoff

This PR queues Codex Anvil smoke testing of the V1.0-beta drop. Anvil should focus on:

  1. Spec/impl drift — ANVIL 3 left 4 P1s open; verify the runbook's ACTION-PLAN.md reflects what's actually in this PR
  2. ADR-006 boundary — confirm benchagi does NOT build a directive-queue adapter (the cloud-brain transport stays via local gateway only; remote brain is the orchestrator's concern)
  3. Test-runner fix — confirm dropping --import tsx is correct (no compiled .test.js imports .ts source)
  4. Build/test reproducibilitynpm install && npm run build && npm run test:v2 should produce 34/34 green from a clean clone

Codex automation polls hourly for PRs labeled anvil. This PR will carry that label.

Test plan

  • npm install && npm run build && npm run test:v2 → 34/34 pass from clean clone
  • npm run lint → silent success
  • benchagi doctor against brew openclaw 2026.5.2 → all method validations green
  • benchagi --agent <name> "ping" → single-turn ask completes, two-clock liveness shows healthy
  • benchagi REPL → multi-line input + history work
  • Codex Anvil pass posts a review comment

🤖 Generated with Claude Code

Drops the V2 streaming CLI built across the prior session:
- WebSocket transport against local OpenClaw gateway (protocol v3)
- Event router with taxonomy unwrap + dedupe (LRU)
- Two-clock liveness (run-quiet + gateway-tick)
- Multi-line REPL with history
- Approval state machine (exec / plugin)
- Firebase Direct auth (browser-to-loopback)
- Doctor probe with full method validation
- Capability probe (model heuristic + override)
- Short-name agent resolution
- Phase 1 spec, ADR-001..006, ANVIL-2 + ANVIL-3 receipts
- 34 unit tests across 5 files (probe, event-router, liveness, agents, state)

Includes test-runner fix: dropped dead --import tsx loader from test:v2
(compiled .test.js files import only .js, never .ts).

Verified live against brew openclaw 2026.5.2: doctor + agents list +
single-turn ask + REPL all working. 34/34 tests green via
npm run test:v2.

V1.1 follow-ups tracked in docs/v2/ACTION-PLAN.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@LightDriverCS LightDriverCS added the anvil Queue for Codex Anvil smoke testing (Hammer-Anvil PR handoff) label May 6, 2026
- **P1 (lint script silently passes failures)**: dropped the
  `find ... 2>/dev/null || true` tail from the lint script. The
  `|| true` masked failures from `node --check` on the bin entry
  points, so a syntax error in `bench.mjs` or `benchagi.mjs` would
  exit 0. The find was speculative — there are no `.mjs` files in
  `src/v2` (TypeScript only) and `test/` only contains `smoke.mjs`
  which doesn't need a separate lint pass. Lint now strictly
  validates `bin/bench.mjs` + `bin/benchagi.mjs`.

- **P2 (ACTION-PLAN.md count drift)**: PR body said 4 deferred P1s
  but `ACTION-PLAN.md` listed 7 items under "P1 deferred to v1.1".
  Renamed the section to "Deferred to v1.1" and tagged each item
  with its actual ANVIL-3 severity (items 1–4 P1, items 5–6 P2/
  housekeeping, item 7 separate from A1-A6 sequence).

- **P2 (README test count over-claim)**: README said "34 V2 unit
  tests" but the actual count is 35 once agents.test.ts is added.
  Dropped the exact number to avoid future drift; described the
  scope instead.

No behavior change. Tests still green.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@LightDriverCS
LightDriverCS merged commit 6c4eed3 into main May 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anvil Queue for Codex Anvil smoke testing (Hammer-Anvil PR handoff)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant