Skip to content

test(oauth): exercise the account-removal path the quorum test is named for - #3600

Merged
lidge-jun merged 1 commit into
devfrom
codex/260905-quorum-removal-contract
Sep 5, 2026
Merged

test(oauth): exercise the account-removal path the quorum test is named for#3600
lidge-jun merged 1 commit into
devfrom
codex/260905-quorum-removal-contract

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #3530. The restored contract test removing an account invalidates immediately, not after the TTL never removed an account: it cleared session affinity, marked the store unread, and asserted only that the store was re-read. With two accounts still in the roster the predicate could not observe the transition the test is named for, so deleting the removeAccount call from the DELETE route would have left it green. The test now mirrors the route order (removeAccount first, then clearAnthropicSessionAffinityForAccount) and asserts quorum is actually false afterward.

Unit: devlog/_plan/260905_open_work_closeout/ (050 E0, 051).

Verification

  • bun test tests/routing/anthropic-quorum-cache.test.ts — 7 pass / 0 fail. RED probe: with the new removeAccount line commented out the new toBe(false) assertion fails (6 pass / 1 fail), proving the assertion observes the roster reduction; the sibling "manual account selection invalidates immediately" test still passes with two accounts intact.
  • bun run typecheck — exit 0.
  • Test-only change; hosted CI on the final dev tip is the batch gate per maintainer instruction.

Checklist

  • Targets dev
  • Test proven RED without the behavior it guards
  • No runtime change

Summary by CodeRabbit

  • Tests
    • Updated routing tests to verify that removing an account immediately invalidates the associated quorum cache.
    • Test behavior now matches the account deletion flow more closely.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 03:26
@lidge-jun lidge-jun added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 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-09-05T03:28:46.504173Z d73d1bc 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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer admin merge (ruleset bypass recorded per MAINTAINERS.md): test-only follow-up to #3530; 7/0 locally with a RED probe; per maintainer instruction the final dev-tip CI run is the acceptance gate for this batch. wp5 E0 of the 260905 open-work closeout.

@lidge-jun
lidge-jun merged commit 3191fe1 into dev Sep 5, 2026
7 of 10 checks passed
@lidge-jun
lidge-jun deleted the codex/260905-quorum-removal-contract branch September 5, 2026 03:27
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: f447e84e-b184-46a6-8e54-84eef0060b1c

📥 Commits

Reviewing files that changed from the base of the PR and between 593978d and d73d1bc.

📒 Files selected for processing (1)
  • tests/routing/anthropic-quorum-cache.test.ts

📝 Walkthrough

Walkthrough

The test now mirrors the account deletion flow. It removes the account, clears session affinity, and verifies that hasAnthropicFailoverQuorum returns false.

Changes

Quorum cache invalidation

Layer / File(s) Summary
Account removal invalidation test
tests/routing/anthropic-quorum-cache.test.ts:28, tests/routing/anthropic-quorum-cache.test.ts:161-171
The test imports removeAccount, removes the credential before clearing session affinity, and asserts that hasAnthropicFailoverQuorum(start + 1) returns false after removal.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260905-quorum-removal-contract

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d73d1bca04

ℹ️ 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".

Comment on lines +168 to 169
expect(await removeAccount("anthropic", ids[1]!)).toBe(true);
clearAnthropicSessionAffinityForAccount(ids[1]!);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route the test through the DELETE handler

If the Anthropic branch in oauth-account-routes.ts stops calling clearAnthropicSessionAffinityForAccount, this test still passes because it manually performs both the store removal and cache invalidation. The existing DELETE API test only verifies that the roster shrinks, so the production regression—completed account deletion leaving the cached quorum true for the TTL—would remain undetected. Invoke the DELETE handler/endpoint here, or add the quorum assertion to the API test, rather than duplicating its implementation.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant