Repository navigation
Feat: agent mode - #2
Conversation
Review — solid architecture, one gap before mergeRan the branch locally: Highlights
Blocking
for _, t := range a.Reg.All() {
if toolkit.IsLongRunning(t) { continue } // watchers can't complete in a turn
if !a.Policy.Allows(t.Tier()) { continue }
...
}Nits (non-blocking)
Also noted: this PR fixes the same Groq Great PR overall — fix the watcher leak and I'm happy to merge. |
mon.watch, mon.alerts, upgrade.watch were still advertised to the model and run under WithCancel (no deadline) — a call would hang the turn. Now filtered from toolDefs AND refused in execCall so even a scripted provider cannot block a turn; regression tests cover both layers. Also: audit.Log/Path/Close nil-sink guards on zero-value Logger, and explicit errcheck discards in serve.go (Shutdown/Encode/Write). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Follow-up on the review — both items are now addressed in Blocking: long-running tools in agent turns — fixed in two layers:
Regression tests in CI lint (errcheck) — fixed the three findings in Also landed the nit from the earlier comment: Verified locally: |
Agent mode: end-to-end (PLAN.md §5)
Finishes agent mode from PLAN.md §5. One agent session now drives every front-end (chat TUI, line REPL,
ask, and a new local web chat), with the same approval policy, redaction, and audit trail in each.What's new
Agent core (
internal/agent)--no-stream/agent.no_streamto disable.agent.Event: delta, text, tool_start, tool_result, approval) replaces the per-UI callbacks; every front-end just renders it.ops(observe/diagnose auto, local-change confirm, on-chain confirm) andreadonly(mutating tools hidden from the model and hard-blocked). Local-change can be autopiloted; on-chain can never be, enforced in code and rejected in config./mode,/approve,/model,/runbook,/tools,/profile,/audit,/reset, the same in the TUI, REPL, and web.monitor.Collect(version, height, peers, signing, jail, disk, EVM drift), cached with a 60s TTL and capped at 1 KB.cometcli audit replay <id>feeds recorded LLM turns and tool output back through the real loop. No LLM or node access.Safety
redact_hosts/redact_endpointsmask hostnames and IPs.COMETCLI_OFFLINE=1disables the agent; all CLI commands andcometcli mcpkeep working.net add-peer/rm-peer,snap statesync --apply) via the newtoolkit.Diff.Audit
kind: llm), the exact tool text the model saw (plus a digest), and signed tx bytes at broadcast are now logged.cometcli audit sessions.Front-ends
cometcli serve [--open]: local web chat. Loopback only, one-time token link plus an HttpOnly cookie, Host-header check (prevents DNS rebinding), JSON-only POSTs (blocks cross-site form posts). Approval modals show diffs and tx details.cometcliopens the chat TUI when a profile exists and stdin is a terminal; otherwise it shows help.Bug fixes found while testing against local docker validators
sec.exposurereported "0 critical" on macOS. It parsed nothing (noss, and BSDnetstatprints*.26657) and treated empty as clean. It now readsdocker portfor docker profiles, parses BSD netstat, and errors instead of passing when it can't read any sockets. On the local network it now correctly reports 6 public ports per validator.*SSHwas closed inContext.Close. This predates this PR.ObjSchemaemitted"required": null/"properties": null. Now omitted or{}, with a regression test over every registered tool.Config additions (
agent:in a profile)mode,autopilot,redact_hosts,redact_endpoints,no_stream. All optional; existing profiles behave as before (ops mode).Docs
TESTING.md(new): step-by-step local testing against docker validators, plus free LLM options (Groq, Ollama, OpenRouter).docs/COMMANDS.md: new commands, flags, session commands, agent config..gitignore:/bin/.Testing
go test ./...andgo vet ./...pass; agent, serve, and TUI tests also pass under-race.primium-evmdocker validators with a fake streaming LLM:askwith tool calls, redaction verified in the outgoing request,audit replaywith the LLM down,serveover HTTP, and a headless browser render.Verified live
Not verified
node.serviceandupgrade.preparekeep their existing approval details.