Repository navigation
Conversation
PR #4404 (FIX-2410) said the Flow State page stays off `live` and keeps `BackgroundWorkRefresh`, because live mode broke three Kitchen Sink E2E specs. Its final merge of main (b13a2d7) resolved the page and the background-work panel to the branch side instead: `live: true` on the assistant's `useSession`, and the stream-end re-read deleted. That merge landed on main as c247ebc, and from then on the same three specs fail: - talk-from-page:403 sees the assistant's session followed by a `/sessions/:id/stream` it must not open. - workforce-shell:82 never reaches `networkidle`: the live session stream holds a connection open for as long as the page is mounted. - background-work:17 loses the row under suite load: with the stream-end re-read gone, the list only updates when the live stream names a run. Restore both files to their pre-#4404 contents, which is what #4404 described. Moving the page to live mode stays the follow-up #4404 named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
|
@codex review This restores two Kitchen Sink files to their state before #4404. The one thing I'm unsure of: does anything merged since c247ebc depend on the Flow State page being on Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4423dc2fab
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| useEffect(() => { | ||
| const finished = wasStreaming.current && !isStreaming; | ||
| wasStreaming.current = isStreaming; | ||
| if (finished && usesBackgroundWork) void refresh(); |
There was a problem hiding this comment.
Use the state-only refresh for background-work discovery
Once a conversation has used background work, this effect downloads and paginates its entire item history after every subsequent turn, adding history-sized network and server work even though it only needs to refresh the child-session list. Unlike the pre-#4404 implementation, the current framework supports refresh({ items: false }): packages/react/src/hooks/useSession.ts performs the same child-session refresh without fetching item history. Use that option here; completed requests already trigger their own full snapshot refresh in onRequestStatus.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 756c724. The stream-end re-read is now refresh({ items: false }).
I checked this against packages/react/src/hooks/useSession.ts:
refresh({ items: false })runsrefreshStateandrefreshChildSessionstogether and reads no item pages.- A completed request already gets the full
refreshSnapshot()in the terminal branch ofonRequestStatus. - That branch does not re-read child sessions, so this component is still what brings a just-filed job's row onto the screen.
I updated the component's cost notes to match.
Verification: a test-mode production build, CI=1, --retries=0.
- The three specs: 3/3 passed.
- The full Kitchen Sink E2E suite, run twice: 48/48 both times.
background-work.spec.tspassed under full-suite load each time. - Kitchen Sink typecheck is clean and its unit tests pass (431).
🤖 Generated with Claude Code
https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Generated by Claude Code
…FIX-2506)
`BackgroundWorkRefresh` called `refresh()`, which re-reads the whole item
history on every finished turn in a conversation that uses background
work. A completed request already gets that full read from `useSession`'s
terminal branch, so the stream-end re-read only needs the dispatched-run
list: `refresh({ items: false })` reads state and child sessions with no
item pages (Codex review on #4596).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
The problem
Since #4404 merged, Kitchen Sink E2E on
mainfails the same three specs every run (45 others pass). Every PR offmainshows a red E2E check, and that check stops catching anything new.background-work.spec.ts:17— the background-work row never appears.talk-from-page.spec.ts:403— the page opens a session stream on the assistant's own session.workforce-shell.spec.ts:82—page.waitForLoadState("networkidle")times out at line 94.What this does
It puts the Flow State page back to how #4404 said it would leave it. #4404 (FIX-2410) states: "The Flow State page stays off
livemode and keepsBackgroundWorkRefresh. Turning live mode on broke three Kitchen Sink E2E specs (background-work, talk-from-page, workforce-shell), so it was dropped from this PR." Its last merge ofmaininto the branch (b13a2d7) resolved the conflict the other way. It kept the branch'slive: trueon the page'suseSessionand deletedBackgroundWorkRefresh. That merge reachedmainas c247ebc.One cause produces all three failures:
live: trueopens aGET /api/flows/sessions/:id/streamon the assistant's session and keeps it open while the page is mounted. That is the extra id in talk-from-page'sfollowedlist. It is also why the network never goes idle in workforce-shell.BackgroundWorkRefresh: the background-work list is re-read only when the live stream names a run. Under the full suite's load the row doesn't arrive within 30 s. The spec passes when run alone, so only the full-suite run reproduces it.The diff puts both files back to their state before #4404 (6443ddf), with one change. The restored stream-end re-read now calls
refresh({ items: false }), which #4404 added, so it re-reads state and the background-work list without the item history. A completed turn already re-reads the full history on its own. This change came from Codex review.What's asked of you
Nothing here is yours to decide. This restores the behaviour #4404 described. Moving the page to live mode is still the follow-up #4404 named, and that change will have to make these three specs pass.
Parts worth reviewing closely
livedoc onuseSessionsays to leave it off for a view only one person writes to. It also says the stream "holds a connection open while the view is mounted". feat(react): state-only re-read in useSession, and the followed request's status (FIX-2410) #4404's own description chose to keep the page off live. So the specs hold the intended behaviour, and I have not changed any of them.git show b13a2d7f8^2:apps/kitchen-sink/app/flow-state/page.tsx(main side) has noliveand mountsBackgroundWorkRefresh.b13a2d7f8^1(branch side) haslive: true. The merge result took the branch side. feat(react): state-only re-read in useSession, and the followed request's status (FIX-2410) #4404's own E2E check failed on these same three specs (run 41539272391).Linear: FIX-2506 · Bug, direct route, no spec · Merges to
main.How to review this
Engineering calls
livewould test the implementation, not the behaviour.apps/kitchen-sinkis private.Everything else — verification
Introducing commit: c247ebc (merge of #4404). Last green
mainCI is 6443ddf, the base of that merge. On #4404's own head b13a2d7, Kitchen-sink E2E failed these same three specs (run 41539272391: 3 failed / 45 passed). Every latermainrun with E2E (41556304309 among them) fails the same three. #4485 (9634cdb) and #4513 (spec-only), between them, don't touch Kitchen Sink. #4510 (FIX-2408) and the bus (#4594) are both in this branch's base and the full suite passes with them, so neither is a cause.Local repro used a production build in test mode (
KITCHEN_SINK_TEST_MODE=1 NEXT_PUBLIC_KITCHEN_SINK_TEST_MODE=1),CI=1,--retries=0. The pre-installed Chromium build differs from the one the pinned Playwright expects, so I ran the repo config through an uncommitted wrapper that sets onlylaunchOptions.executablePath.main4425231The one failure in run 2 was
claude-code-mode.spec.ts:88: a console 404 on/claude-code, a route that doesn't render the Flow State page. It passed 42 of 42 times on its own (--repeat-each=6) and in the other three full runs. I don't attribute it to this change, and I've noted it as a separate flake.pnpm --filter @flow-state-dev/kitchen-sink typecheckpasses.pnpm --filter @flow-state-dev/kitchen-sink test: 52 files, 431 passed. One earlier run had twocodex-session.test.tstiming failures under load. That file passes alone 18/18 and doesn't import either changed file.What would have prevented this: Kitchen-sink E2E is not a required check. #4404 merged with it red on these same three specs, and its description said the change behind them had been dropped.
https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Generated by Claude Code