Add ask-the-author: interrogate a task's implementing agent during review - #366
Draft
dkrattiger wants to merge 1 commit into
Draft
Add ask-the-author: interrogate a task's implementing agent during review#366dkrattiger wants to merge 1 commit into
dkrattiger wants to merge 1 commit into
Conversation
…view
Expose a task's claude session as an API a review tool (the tarot half)
can drive: a reviewer posts a question, panopticon delivers it to the
task's agent, and the reviewer polls for the answer.
Contract (task service, REST):
- GET /tasks/lookup?repo_id=&branch= | ?url= — resolve a task, 404 if none
- POST /tasks/{id}/ask {question, context} — {ask_id}; capped at one
unanswered ask per task (409); 404 for an unknown task
- GET /tasks/{id}/ask/{ask_id} — {status, answer}; 410 when
the config volume was reaped (the review tool's fallback signal)
An ask is conversation, not a transition: it never changes state or seeds
responsibilities, so asking a COMPLETE task's author works (the turn may
flip agent->user as it answers, as normal).
Split along the determinism invariant, mirroring provisioning:
- task service holds the ephemeral Ask record (in memory, like registrations
/lifecycle) and enforces the cap; it never touches a container.
- session service (new AskWorker in the host daemon) delivers: inject into a
live tmux session, or --continue-resume a parked/terminal one with the
question as the prompt (spawn_for_ask allows terminal tasks); marks the ask
gone when the volume is reaped.
- container Stop hook extracts the reply from the transcript (by an embedded
marker) and records it — the Stop-hook flip is the completion signal.
Terminal tasks carry a strict read-only guardrail in the delivered message.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Exposes a task's claude session as an API a review tool (the tarot half of ask-the-author) can drive: a reviewer posts a question, panopticon delivers it to the task's implementing agent, and the reviewer polls for the answer. The agent's session — its reasoning about why the code is the way it is — already persists in the per-task config volume and resumes via
--continue; this makes it interrogable.Plan: see the task's
plan.mdartifact.Contract (task service, REST)
GET /tasks/lookup?repo_id=&branch=or?url=— resolve the task by its branch or PR/URL; 404 if none.POST /tasks/{id}/ask {question, context}→{ask_id}— capped at one unanswered ask per task (409); 404 for an unknown task.GET /tasks/{id}/ask/{ask_id}→{status: pending|answered, answer}— 410 when the task's config volume was reaped (the review tool's documented fallback signal).An ask is conversation, not a transition: it never changes workflow state or seeds responsibilities, so asking a COMPLETE task's author works (the turn may flip agent→user as it answers, as normal). Auth is the same same-host trust as the rest of the REST API (v1).
Design (along the determinism invariant, mirroring provisioning)
Askrecord (in memory, like registrations/lifecycle) and enforces the cap; it never touches a container.AskWorkerin the host daemon — delivers: inject the question into a live tmux session, or--continue-resume a parked/terminal one with the question as the prompt (spawn_for_askdeliberately allows terminal tasks so a COMPLETE author can be interrogated). Marks the askgonewhen the config volume is reaped.Terminal tasks carry a strict read-only guardrail in the delivered message (answer about merged/proposed work; don't modify anything).
Notes
default_baseisdimitri/pending-fixes, but per the task memo this PR is kept open againstmainas usual; the integration-branch landing is handled outside this PR.send-keys/paste-bufferpath in the repo; the parked--continuepath covers the common review case (a COMPLETE/parked author).