Skip to content

Feat/claude answer channel oneshot#183

Merged
cukas merged 2 commits into
mainfrom
feat/claude-answer-channel-oneshot
Jun 9, 2026
Merged

Feat/claude answer channel oneshot#183
cukas merged 2 commits into
mainfrom
feat/claude-answer-channel-oneshot

Conversation

@cukas

@cukas cukas commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

cukas and others added 2 commits June 9, 2026 17:35
Council/forge/brainstorm/tribunal claude members are dispatched one-shot via
runClaudePtyDispatch/runClaudePtyStreamDispatch (exec mode) and their answer is
SCRAPED from the TUI — which corrupts long answers (vertical scroll past `rows`
→ "Cul ura ri k") and intermittently returns chrome bleed / empty.

Add an opt-in structured answer channel (AGON_CLAUDE_ANSWER_CHANNEL=file): claude
writes its complete answer to a temp file via its already-allowed native Write
tool, and agon reads that file as the AUTHORITATIVE result, falling back to the
scrape only if the file is absent. No MCP, no -p (stays on the flat-rate
subscription TUI), no kern-engines change. Default off.

This mirrors how Cesar (session-pty.kern) already delivers via DeliverAnswer, but
without an agon dependency — so the same primitive is portable to kern-sight,
which has the identical scrape bug. The mcp variant (DeliverAnswer) is reserved
as 'mcp' mode for a follow-up; readAnswerChannelFile already accepts both raw
markdown (file) and a {text} JSON envelope (mcp).

Validated live via `agon ask claude` on the exact corrupting prompt class
("cultural risk / unprecedented permanent consequences", 3 paragraphs):
breadcrumb `answer-channel(file): hit 1917ch`, output byte-clean. Channel-off
path unchanged (regression-checked). 20 adapter-helpers unit tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Flip AGON_CLAUDE_ANSWER_CHANNEL from default-off to default-ON for one-shot
claude exec dispatch, matching kern-sight: council/brainstorm/tribunal/synthesis
members now deliver via the clean Write-to-file channel automatically, with no
env var to set. Opt out with AGON_CLAUDE_ANSWER_CHANNEL=off (raw scrape, for
debugging). Still falls back to the scrape whenever claude doesn't deliver, so
it is never worse than before.

Gate the per-dispatch breadcrumb behind AGON_DEBUG so default-on doesn't add
stderr noise to every council run.

Validated live: zero-config `agon ask claude` → channel hit (5/5 across runs);
`=off` correctly disables it. 20 unit tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cukas cukas merged commit 1b89582 into main Jun 9, 2026
2 checks passed
@cukas cukas deleted the feat/claude-answer-channel-oneshot branch June 9, 2026 16:08
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