Support giving agent feedback via web UI#66
Conversation
Add shared feedback types, SQLite persistence, local API routes, and a submission sink for stagereview show. Wire the review UI so users can draft file and line comments, submit them as a batch, and have the agent receive the submitted payload.
Stop stagereview show from launching the default browser, print a Review URL instead, and update the stage-chapters skill to relay that link to the user. Remove the now-unused open dependency from the CLI package.
Set mise to use Node 25.9.0 so the CLI and native SQLite dependency match the agent shell used during local stage-chapters testing.
Document that stage-chapters now prints a local review URL instead of opening the browser automatically, and mention submit-only feedback delivery.
|
Ready to review this PR? Stage has broken it down into 14 individual chapters for you: Chapters generated by Stage for commit e5e2bc4 on Jun 5, 2026 5:07pm UTC. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e5e2bc4. Configure here.
|
|
||
| await opts.deliverSubmission?.(submission); | ||
| writeJson(res, 200, { submission }); | ||
| opts.onSubmitted?.(); |
There was a problem hiding this comment.
Feedback persisted before agent delivery
High Severity
The submit handler marks every draft comment as submitted in SQLite before deliverSubmission runs. If delivery fails (for example appendFile errors), the API returns an error but comments stay submitted, so the UI refetch shows them as non-editable while the agent may never receive a consistent STAGE_FEEDBACK_SUBMITTED payload.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e5e2bc4. Configure here.
| const chapterFilePathSet = useMemo(() => new Set(chapterFilePaths), [chapterFilePaths]); | ||
| const chapterFeedbackComments = useMemo( | ||
| () => filterFeedbackForChapter(feedback.comments, chapter.id), | ||
| [feedback.comments, chapter.id], |
There was a problem hiding this comment.
Files tab feedback hidden on chapters
Medium Severity
Chapter pages only show feedback whose target.chapterId matches the current chapter. Comments created from the Files tab omit chapterId, so they disappear from chapter diffs and sidebar counts even when the same file appears in that chapter.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e5e2bc4. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5e2bc49f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return; | ||
| } | ||
|
|
||
| await opts.deliverSubmission?.(submission); |
There was a problem hiding this comment.
Preserve drafts when feedback delivery fails
If deliverSubmission rejects here (for example the feedback JSONL append fails or stdout is unavailable), submitDraftFeedback has already changed every draft to submitted in the database. The request then returns 500, but the user cannot retry because a second submit sees no drafts and edit/delete now return 409, so the feedback can be stranded without being delivered. Keep the comments draft until the sink succeeds, or otherwise make failed deliveries retryable.
Useful? React with 👍 / 👎.


Summary by cubic
Adds browser feedback so reviewers can draft file and line comments in the web UI and submit them as a batch for the agent.
stagereview shownow prints a local review URL instead of auto-opening a browser.New Features
/api/runs/:runId/feedback, persisted in SQLite.feedback/<runId>.jsonlin the repo data dir and echoes the JSON payload to stdout.@stagereview/types/feedback.Migration
stage-chaptersnow shows the link instead of launching a browser.Written for commit e5e2bc4. Summary will update on new commits.