fix: wait for metadata before archive cascade - #577
Conversation
Model: gpt-5.6-sol Signed-off-by: Dante <duanjl.china@gmail.com>
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: 8f8fbe28d7
ℹ️ 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".
Model: gpt-5.6-sol Signed-off-by: Dante <duanjl.china@gmail.com>
|
@Dante-dan, this pull request needs updates before review. It is marked If the PR remains invalid for 7 days, it will be closed and marked Policy findings |
Related issue
Closes #574
Problem / pressure
Session Detail can expose a bootstrapped root Session before the initial workspace metadata scan has discovered its child Tabs. Archiving during that window derived lifecycle targets from a partial cache, so the root could be archived while a direct
parentSessionIdchild stayed active.Summary
Visual explanation
flowchart LR A[Archive requested for root] --> B{Captured runtime cache ready?} B -->|No| C[Wait for ready scope] C -->|Runtime changed| D[Reject without writes] C -->|Root + child hydrated| E[Derive lifecycle targets] B -->|Yes| E E --> F[Archive root and child Tab]Before / after
Test plan
pnpm --filter @lody/components exec vitest run tests/use-session-actions.test.ts— passed, 30/30 tests.pnpm --filter @lody/components typecheck— passed.pnpm format— passed.pnpm run docs check— passed with no errors.node .github/scripts/check-pr-body.mjs --body-file <this body> --changed-lines 230— passed.Context handoff
Instructions for reviewing agents
waitForDocMetaCacheReadycannot author archive writes before the captured runtime owns a ready cache and that both hydration and runtime-switch tests exercise observable state.Authoring context
isArchivedstate transition and machine queue updates.