Skip to content

Write the review trace while the review runs - #58

Merged
TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-ysk2fa
Nov 20, 2026
Merged

TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-ysk2fa

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

What

A running review's page in the Console showed no live trace. The Console already polls the events endpoint every 5 seconds while a review runs, but runReviewJob kept every step in memory and wrote them only after runReview returned (and in the failure path). So the polling had nothing to show until the review finished.

Each recorded step now queues a write. Steps recorded while a write is in flight are carried by the next one, so a busy review sends batches rather than one request per step. Writes stay in order and stay off the model's critical path: they chain on the same pendingWrites as the existing flush, and the final flush() calls are unchanged.

Test plan

  • New test in review-job.test.ts: the model checks the stored trace while it runs and sees review.mode. It fails without the change and passes with it.
  • bun run lint, bun run check and bun run test (483 pass) all pass.

Related Console polish: appwrite/appwrite#15879.


Generated by Claude Code

The trace was buffered in memory and written only once the review
finished, so a running review's page in the Console showed no steps
even though it polls for them. Each step now queues a write; steps
recorded while one is out go in the next, so a busy review sends
batches rather than a request per step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7tuyQdK2G5ViFDvatmP
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
@TorstenDittmann TorstenDittmann self-assigned this Nov 20, 2026
@appwrite

appwrite Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Code review

Commit Status Tier Verdict Details
bd3a86c Reviewed Reviewed 🟢 S · Ready to merge ✅ Approved View review

The queued writes remain serialized and preserve the existing final flush behavior.

Review trace events are now queued for persistence as they are recorded, allowing the Console to observe progress before the review finishes. The added test checks that a trace event is available while the model is still running.

Walkthrough (2)
File Change
packages/engine/src/review-job.ts Queues trace and usage writes as review events arrive, serialized with existing flushes.
packages/engine/src/review-job.test.ts Verifies a trace event is stored while the model is running.

Reviewed bd3a86c

Tip

Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot 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.

🟢 Tier S · Looks good to merge. Summary

@TorstenDittmann
TorstenDittmann merged commit d8fd5f2 into main Nov 20, 2026
4 checks passed
@TorstenDittmann
TorstenDittmann deleted the claude/project-thread-ysk2fa branch November 20, 2026 14:28
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