Skip to content

test(flows): wait for the builder result's delivery turn before the save (fixes red main) - #8479

Merged
M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:test/builder-chat-e2e-delivery-race
Oct 28, 2026
Merged

M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:test/builder-chat-e2e-delivery-race

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes red main: json_rpc_flows_builder_chat_e2e failed intermittently ("timed out waiting for the create_workflow approval request"), in CF-BASE-8b6ec8b and in 1 of 3 solo runs.
  • The cause is a race in the test. After the first builder finishes, its result is delivered into the thread by a background delivery turn. When that turn ran late, it consumed responses the test had scripted for the "save it" step.
  • The fix: before scripting the save, wait until the delivery turn's reply is stored in the thread.
  • Test-only: one file, +15.

Proof (cuttlefish)

Pending.

Submission Checklist

  • Tests added or updated: the builder-chat e2e waits for the delivery turn.
  • N/A: Diff coverage ≥ 80%. Test-only change; no product lines change.
  • N/A: Coverage matrix updated. No feature change.
  • N/A: All affected feature IDs listed. No feature change.
  • No new external network dependencies introduced
  • N/A: Manual smoke checklist. No release-cut surface changed.
  • N/A: Linked issue. Red-main fix found by the pre-prod CF-BASE run; related PRs are listed below.

Related

Summary by CodeRabbit

  • Tests
    • Updated the end-to-end chat workflow test to wait for the workflow builder’s result to arrive as a background message before continuing with the proposal save step. This verifies that the chat flow handles the result delivery before the next orchestrator turn proceeds.

@tinysweeper

tinysweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 265ccf1b65251ed56b2ed9b2e659abdcc6ef2b4e

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
Pull request purpose (title): test(flows): wait fo…

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(flows): wait for the builder result's delivery turn before the save (fixes red main). The latest-push-delta comparison is unavailable.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

Inside `chat_spawns_workflow_builder_and_saves_its_proposal`, after the first builder step and before step 4 scripts the orchestrator, a new `wait_for("the builder result's delivery turn", …)` polls `thread_messages` and resolves on the first message whose `extraMetadata.scope` is `background_delivery`. Production code is untouched.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Answered lane with no findings: the wait sits before step 4's scripting, the `background_delivery` row appears only after `run_system_turn_on_thread` resolves via `persist_delivery_reply`, and the polling is bounded by `wait_for`'s 300 × 100 ms ceiling with a diagnostic panic rather than a hang.
  • Lane summary: The added block polls the parent thread for the persisted `background_delivery` row before step 4 scripts the orchestrator. That row is written by `persist_delivery_reply` only after `run_system_turn_on_thread` resolves (persist-then-announce), so its presence means the delivery turn has finished making model calls and can no longer consume the save's scripted `spawn_subagent`; the wait is bounded by `wait_for`'s 300 × 100 ms ceiling and panics with a diagnostic rather than hanging. I found no defect in the change. _The code index is behind this pull request (indexed at `37c5f9f275df`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Answered lane with no findings: test-only polling wait using existing `wait_for`/`thread_messages` helpers under the same 30s budget; no untrusted input, network, or authn/authz surface touched.
  • Lane summary: The diff adds a polling wait that blocks step 4 until the builder completion's debounced delivery turn has persisted its reply in the thread, closing a FIFO race where that turn could otherwise take the save's scripted `spawn_subagent` completion. It is test-only, uses the existing `wait_for`/`thread_messages` helpers under the same 30s budget, and touches no untrusted input, network, authn/authz, or repo-rule-carrying code. Nothing reportable. _The code index is behind this pull request (indexed at `37c5f9f275df`), so retrieved context may be out of date._

tests

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No behavioural change: nothing outside documentation, configuration and tests.

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Answered lane: no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `37c5f9f275df`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Answered lane with no findings: the description matches the test-only diff (+15 lines, one file) — a `wait_for` on a `background_delivery`-scoped thread message before step 4, consistent with `persist_delivery_reply` writing that scope before announcing the reply. The lane could not verify the body's own "Proof (cuttlefish): Pending".
  • Lane summary: The description matches the diff: a test-only change to `tests/json_rpc_flows_builder_chat_e2e.rs`, +15 lines, which adds a `wait_for` on a thread message whose `extraMetadata.scope` is `background_delivery` before step 4 scripts the orchestrator completions — exactly what the summary and the CodeRabbit note say, and consistent with `persist_delivery_reply` writing that scope before announcing the reply. The stated file count and size are correct and nothing significant in the diff goes unmentioned; the loose end is the body's own "Proof (cuttlefish): Pending", which I could not verify from here. _The code index is behind this pull request (indexed at `37c5f9f275df`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.011184
  • Tokens: 163710 input · 12413 output · 43520 cached · 91 embedding
  • Updated: 2026-10-28T06:05:06Z
Head State Pass summary
9a3dff3f54ab ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-28T06:01:49Z)
265ccf1b6525 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-28T06:05:06Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T06:03:44.652342Z 9a3dff3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 076febf3-7ca3-4cbb-a180-381ad16ab166
Commits

Reviewing files that changed from the base of the PR and between 8b6ec8b and 9a3dff3.

Files selected for processing: 1
  • tests/json_rpc_flows_builder_chat_e2e.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The builder chat E2E test now waits for a thread message with extraMetadata.scope set to background_delivery before continuing to the agent-side save step.

Changes: Builder chat test synchronization

Layer / File(s) Summary
Wait for the builder delivery message
tests/json_rpc_flows_builder_chat_e2e.rs
The test waits for a background_delivery message in the thread before proceeding to the agent-side save step.

Priority: Not assessed

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: senamakel, tinysweeper

Merge Risk: Minimal · up to 265cc

No actionable current-head risk is established; the synchronization change is mergeable.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main test change: waiting for the builder result's delivery turn before the save. It also identifies the test scope and the reason for the fix.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit waits beside the thread,
For delivery to be read.
The save turn starts when it appears,
No racing steps, no tangled gears.
Then hops away with carrots near.

Comment @coderabbitai help to get the list of available commands.

@tinysweeper tinysweeper 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.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0028

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 28, 2026
A finished async sub-agent is delivered into the thread by a debounced
turn. When it ran late it consumed the responses scripted for the save
step. Wait for that turn's stored reply before scripting the save.
@M3gA-Mind
M3gA-Mind force-pushed the test/builder-chat-e2e-delivery-race branch from 9a3dff3 to 265ccf1 Compare October 28, 2026 06:03
@M3gA-Mind
M3gA-Mind merged commit 45500ae into tinyhumansai:main Oct 28, 2026
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant