Skip to content

Poll question answers without rebuilding reviews - #16

Merged
mchwang merged 1 commit into
mainfrom
codex/lightweight-question-polling
Sep 24, 2026
Merged

mchwang merged 1 commit into
mainfrom
codex/lightweight-question-polling

Conversation

@mchwang

@mchwang mchwang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Answer polling currently calls ReviewService.load() every two seconds, rebuilding Git history, linkage, previews, and the review token just to observe a persisted agent attempt.

Read question answer state directly from SQLite and add the question manager's in-memory active marker. Poll responses contain only note IDs, answer state, and active state. The browser merges those fields into notes already owned by the displayed review, so polling cannot replace snapshot, plan, assignment, reference-validity, ordering, or text metadata. The existing generation guard continues to reject polls started before an action or Refresh.

Before/after: the focused browser regression measured one full review load for a single poll before this change and zero afterward. It also observes the completed answer in the UI and SQLite, confirms the polling payload omits note text, and proves explicit Refresh still performs a full load.

Validation at exact head 885cf09: typecheck, 188 unit/integration tests, and 39 browser tests pass locally. Both CI runs pass.

Review-lesson audit

Deferred: #10 review-summary edge cases and #3's human go/no-go experiment remain separate work.

Closes #12.

Copilot AI lite review requested due to automatic review settings September 24, 2026 00:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified, and all reviewers assessed it as ready.

Review effort: Lite
Findings: None

What changed in this PR

This PR replaces full review rebuilds during question polling with lightweight persisted answer-status reads.

Changes:

  • Adds SQLite-backed question status polling.
  • Safely merges answer and active-state updates in the browser.
  • Adds regression coverage and implementation documentation.
File Description
web/​server.ts Provides lightweight question status polling.
web/​public/​app.js Merges polling updates without replacing review metadata.
test/​browser/​review.spec.ts Verifies polling efficiency and Refresh behavior.
docs/​implementation/​read-only-review.md Documents the polling design and guarantees.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mchwang
mchwang merged commit 5a2685c into main Sep 24, 2026
3 checks passed
@mchwang
mchwang deleted the codex/lightweight-question-polling branch September 24, 2026 00:15
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.

Avoid rebuilding the full review when polling agent answers

2 participants