Skip to content

test: stop main failing on three tests the store and close-cause changes crossed - #24231

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/main-fix-close-cause-tests
Sep 30, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/main-fix-close-cause-tests

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1
Prod 0 0 0 0

ELI5

Main's typecheck is failing, so every PR that merges main fails CI. Three tests were written against old versions of code that has since changed, and this PR updates them. No user-facing change: only three test files change.

What Changed

Three PRs crossed on main:

The fix:

  • codex-provider-retry-idle-sweep.test.ts opens the store with the existing openTestAgentSessionRecordStore helper, and expects the idle sweep's close to carry 'evict', as the file's other close checks already do.
  • structured-chat-tab-table.test.ts passes 'user-close' to host.close.
  • structured-agent-session-startup-reconcile.test.ts passes 'user-close' to the runtime's close and expects it on the host close. It typechecks on main (it reaches the method through a cast) but fails when run.

Why

Main's typecheck fails on these calls (tc:node), and the idle-sweep test also fails when run. The fix changes the tests to match what shipped, not the other way round, because each production change was intended.

Linked Issue

Follow-up to #24006, #23467 and #23684 (no issue: a main CI regression).

Visual Proof

N/A: only tests change.

Testing

  • The three files pass: 18 tests. The startup-reconcile test fails on main's copy and passes with this change.

  • tsc -p config/tsconfig.node.json shows no errors in either file. The only errors were a missing optional package in the local install.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Differences from the common pattern

None: matches the common pattern. This is a test-only fix.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…e cause

#24006 moved the session store into the chat journal database, and #23467 made close take a cause; #23684's and an older tab-table test still used the old calls, so main's typecheck fails.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test files updated to match API signature changes.

The PR appears safe to merge; no actionable issue was identified.

Summary

The PR updates three tests to match the current session-store setup and close-cause contract. Since the previous review, it also updates the startup-reconcile test to pass and expect 'user-close'.

Reviews (2) · Last reviewed commit: "test: the startup-reconcile close test p..."

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5972e808-207c-471e-85e1-2b4732c4b687

📥 Commits

Reviewing files that changed from the base of the PR and between 36112e7 and 5d377b4.

📒 Files selected for processing (1)
  • src/main/runtime/structured-agent-session-startup-reconcile.test.ts

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


📝 Walkthrough

Walkthrough

Three tests now use explicit session close reasons. The idle-sweep test also uses the test-harness store helper instead of opening the store directly.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 5d377

The test updates align their setup and explicit close reasons with the existing contracts. No production behavior changes or actionable merge-blocking risks are evident.

Architecture Summary

Architecture risk: 🔵 Low · up to 36112

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/main/codex/codex-provider-retry-idle-sweep.test.ts: The test replaces the AgentSessionRecordStore import with the test-harness openTestAgentSessionRecordStore import.
  • observed — Modified behavior in src/main/codex/codex-provider-retry-idle-sweep.test.ts: Test setup replaces direct store opening with the helper, removing the explicit store directory and local host ID options.
  • observed — Modified behavior in src/main/codex/codex-provider-retry-idle-sweep.test.ts: The idle-sweep assertion now expects closeSession to receive the evict reason in addition to the session ID.
  • observed — Modified behavior in src/main/runtime/rpc/methods/structured-chat-tab-table.test.ts: The test now passes user-close to host.close instead of calling it with only the session ID.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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.
Title check ✅ Passed The title identifies the three-test failure and attributes it to store and close-cause changes. It is related to the main change, although its wording is somewhat awkward.
Description check ✅ Passed The description covers the required change summary, rationale, linked context, visual proof, testing, scope, and checklist. It clearly states that the PR updates three tests and reports verification r…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — a test-only fix that restores main's green typecheck after three PRs (#24006, #23467, #23684) crossed.

  • codex-provider-retry-idle-sweep.test.ts — opens the store through openTestAgentSessionRecordStore(root) (the post-#24006 journal-database helper) instead of the removed open({ directory, hostId }), and asserts the idle sweep's close carries 'evict'.
  • structured-chat-tab-table.test.ts — passes the now-required 'user-close' cause to host.close.

I verified both changes against the code they exercise: the idle sweep wires stopAgent(sessionId, 'evict') (structured-agent-session-conversation-lifetime.ts:80) and eviction forwards that cause to adapter.closeSession (structured-agent-session-eviction.ts:93), so the exact-argument assertion pins real behavior rather than absorbing it. 'user-close' is a valid StructuredAgentSessionCloseCause.

pnpm run typecheck:node exits cleanly and the two files run 14 tests green, matching the PR's testing claims.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025 brennanb2025 changed the title test: stop main's typecheck failing on two tests the store and close-cause changes crossed test: stop main failing on three tests the store and close-cause changes crossed Sep 30, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — the incremental delta since the prior review is one commit: the third test file catches up with the already-required session close cause.

  • structured-agent-session-startup-reconcile.test.ts — the cast for closeStructuredAgentSessionTab now declares the required cause: 'user-close' parameter, the call passes 'user-close', and the host assertion is tightened to toHaveBeenCalledWith(sessionId, 'user-close').

I verified this against the code the test exercises: closeStructuredAgentSessionTab(tab, cause) (orca-runtime-close-structured-agent-session-tab.ts:20) forwards cause to host.close(tab.sessionId, cause) (line 37), so the exact-argument assertion pins real behavior. 'user-close' is a valid StructuredAgentSessionCloseCause. The file runs 4 tests green locally, and the two files from the prior review are unchanged.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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.

1 participant