Skip to content

core+app: reviewer chat — ask the agent about the review, adopt drafted comments#37

Merged
alejandro-nexcade merged 4 commits into
mainfrom
alejandro/reviewer-chat
Jul 8, 2026
Merged

core+app: reviewer chat — ask the agent about the review, adopt drafted comments#37
alejandro-nexcade merged 4 commits into
mainfrom
alejandro/reviewer-chat

Conversation

@alejandro-nexcade

Copy link
Copy Markdown
Collaborator

What

The reviewer chat (design: cockpit-docs/REVIEWER_CHAT.md, in this diff). An ✦ Ask agent toggle in the review workspace opens a docked, resizable panel on whatever tab is active — one persistent conversation per PR with the read-only reviewer agent.

  • Stateless turns: each message spawns a fresh one-shot claude in the review's worktree with the full context assembled deterministically (intent, findings, diff, recap, local comments, GitHub conversation, prior transcript capped at 40 messages, the question). New prompt golden pinned.
  • Provably read-only: every turn spawns with --disallowedTools Write,Edit,MultiEdit,NotebookEdit,Bash,Task and no permission-mode flags — it can read/grep the worktree freely and can never mutate or prompt.
  • Transient by construction: no session registration, no Stop-hook URL, never attached to review.agent — invisible to the fleet, the gate, and max_parallel_agents. Dedicated chat-stream/chat-complete events keep it off the AgentPanel timeline. Per-PR turn registry (poison-recovering locks), Stop button, 5-minute hard timeout.
  • Draft comments: "draft a comment for…" returns an inline {"drafts":[...]} block, parsed out of the answer (tolerant, fence-stripping) and rendered as adopt-able cards feeding the existing guarded comment path — agent text reaches GitHub only via explicit adopt + confirmed Mirror/Submit (§9).
  • Head-anchored: the thread persists with the review and clears when the head moves, like findings/intent.
  • Fail-open (§0.1): config/worktree/spawn failures settle in the thread (question kept, error: true reply, pending state released) — the review is never blocked by chat.

Verified

cargo fmt --check · clippy -D warnings · cargo test (583: new parser/prompt/golden/clear/registry coverage) · tsc · vitest 409 (+13: store slice, panel render incl. draft adoption + error turns, width/persistence helpers) · vite build. Reviewer agent pass: SHIP; its three MINORs fixed (poison-safe registry, in-thread failure settling ×2) + MultiEdit denylist NIT.

🤖 Generated with Claude Code

LifeLex added 4 commits July 7, 2026 17:30
…ed comments

Implements cockpit-docs/REVIEWER_CHAT.md: a workspace-level 'Ask agent'
panel with one persistent thread per PR (cleared when the head moves).
Each turn is a stateless one-shot spawn in the review's worktree,
provably read-only (--disallowedTools Write/Edit/NotebookEdit/Bash/Task),
transient (no session, no fleet row, no gate contact), streamed over
dedicated chat-stream/chat-complete events with a per-PR turn registry
and a 5-minute hard timeout. Draft comments come back inline as a
{"drafts":[...]} block parsed out of the answer and rendered as
adopt-able cards feeding the existing guarded comment path (§9).
… settling

Reviewer MINORs: the turn registry now locks through a poison-recovering
helper (a panic in the driver could otherwise leak the claim and wedge a
PR's chat until restart); config/worktree/spawn failures settle IN the
thread (question kept, error: true reply appended, claim released,
chat-complete emitted) instead of erroring the command and leaving the
error only in a banner. MultiEdit added to the denylist. Spec synced
with the error flag.
@alejandro-nexcade alejandro-nexcade merged commit a746f94 into main Jul 8, 2026
2 checks passed
@alejandro-nexcade alejandro-nexcade deleted the alejandro/reviewer-chat branch July 8, 2026 10:12
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.

2 participants