Skip to content

test(sync): expect Pi's server-owned refresh after #8287 - #8606

Merged
lidge-jun merged 1 commit into
devfrom
fix/sync-pi-oracle-8287
Nov 12, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/sync-pi-oracle-8287

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

dev has been red since #8287 (7ce7d5a9). That PR moved Pi out of the direct ocx sync fan-out: an owned Pi file now refreshes through the serving proxy (refreshPiThroughServer in src/cli/pi-sync.ts), because only the proxy can prove Pi's raw nested selectors. Two tests still expected "pi" in the fan-out list:

  • tests/clients/sync-client-integrations.test.ts › "the direct ocx sync command refreshes owned clients including OpenCode and Kilo and server-owned Aside"
  • tests/cli/cli-dispatch.test.ts › "dispatchCommand exit codes > sync refreshes already-owned OpenCode and Kilo after publishing the Codex catalog"

This PR updates both tests to match #8287's design. They now expect the fan-out list without "pi" and check that sync calls refreshPiThroughServer. The dispatch test also stubs that call, so it never sends a real request to its fake port. Runtime code is unchanged.

Verification

Bun 1.4.4 / macOS, isolated HOME/OPENCODEX_HOME/CODEX_HOME/CLAUDE_CONFIG_DIR.

  • Before: on 7ce7d5a9, bun test --isolate tests/cli/cli-dispatch.test.ts tests/clients/sync-client-integrations.test.ts gives 117 pass / 2 fail, and the two failures are the cases above. On its parent 05d34b94 the same command gives 119 pass / 0 fail.
  • After: bun test --isolate tests/cli/cli-dispatch.test.ts tests/clients/sync-client-integrations.test.ts tests/ci-workflows/file-size-ratchet.test.ts gives 128 pass / 0 fail.
  • bun run typecheck (2,442 files) and bun scripts/file-size-ratchet.ts: passed.
  • NOT RUN: the full bun run test suite.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated sync coverage to verify that Pi refreshes through the server and is excluded from the local catalog refresh list. The checks cover both command-line dispatch and direct sync, including confirmation that the Pi refresh is triggered once. No user-facing behavior changes are included in this update.

#8287 moved Pi out of the direct ocx sync fan-out: an owned Pi file now
refreshes through the serving proxy (refreshPiThroughServer), because only
the proxy can prove its raw nested selectors. Two source/dispatch oracles
still listed "pi" in the fan-out, so dev went red at 7ce7d5a.

Assert the fan-out list without "pi" and that Pi takes the server path, and
stub that path in the dispatch test so it never reaches a real port.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 12, 2026 20:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T20:37:09.513875Z d98d560 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 12, 2026
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The sync tests now verify that Pi is excluded from the local owned-catalog refresh and refreshed separately through the server-backed path.

Changes: Pi sync refresh

Layer / File(s) Summary
Verify Pi refresh routing
tests/cli/cli-dispatch.test.ts, tests/clients/sync-client-integrations.test.ts
The tests exclude pi from the local refresh list and assert that refreshPiThroughServer runs. The CLI test mocks the server-backed refresh and restores its spy during cleanup.

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

Change: Other

Possibly related PRs

  • lidge-jun/opencodex#8100: Moves the direct sync runner and updates the same test file. Both changes concern where the Pi exclusion and server-backed refresh are verified.

Suggested reviewers: stevyhacker

Merge Risk: Minimal · up to d98d5

This change only updates tests to match how Pi sync refresh already works. It does not change runtime behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the sync tests now expect Pi's server-owned refresh after #8287. The changeset updates the dispatch test and the direct sync client test to exclude pi from the local r…
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: Title check

Explanation

The title names the main change: the sync tests now expect Pi's server-owned refresh after #8287. The changeset updates the dispatch test and the direct sync client test to exclude pi from the local refresh list and to assert refreshPiThroughServer is called. The title uses the test(sync) prefix, which matches the test-only change. It is specific, concise, and does not use vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7ce7d5a and d98d560.

Files selected for processing: 2

  • tests/cli/cli-dispatch.test.ts
  • tests/clients/sync-client-integrations.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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment

Reviewed head: d98d560a9482ffdec51fa4121f58d6ff3b064ed9.

Final-head review (xai/grok-4.7, high): PASS, no findings. The reviewer confirmed that Pi still refreshes through the server when a live proxy exists, that it reports a refusal or a missing proxy, and that both tests fail at 7ce7d5a9 and pass at this head (128 pass / 0 fail). Required checks were still pending when this merged; the change is test-only, and its focused files pass locally and in review.

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