Skip to content

fix(codex): skip empty native-profile stage sweeps - #1124

Closed
Ingwannu wants to merge 1 commit into
devfrom
agent/fix-1120-native-profile-empty-sweep
Closed

fix(codex): skip empty native-profile stage sweeps#1124
Ingwannu wants to merge 1 commit into
devfrom
agent/fix-1120-native-profile-empty-sweep

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skip native-profile stage sweeping only when both the stage registry and this instance's staging tree are proven absent, so zero-profile installations do not contend on the profile transaction database or fence native-main traffic.
  • Preserve the existing locked, fail-closed sweep whenever an artifact exists or its absence cannot be proven.
  • Identify the resulting 503 as local OpenCodex native-profile maintenance and document the decision and invariants.

Closes #1120

Verification

  • env -u OPENCODEX_API_AUTH_TOKEN taskset -c 0-1 bun test tests/native-profile-stage-lifecycle.test.ts tests/native-profile-drain-server.test.ts tests/codex-auth-context.test.ts — 51 pass, 0 fail.
  • taskset -c 0-1 bun run typecheck — passed.
  • taskset -c 0-1 bun run privacy:scan — passed.
  • git diff --check — passed.
  • Full suite: 9,417 pass, 10 skip, with one existing load-sensitive failure in Live/Realtime sideband retains main ownership while Direct and non-main Pool continue. The failing case then passed seven consecutive isolated/focused executions.

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.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24160e9e-4f2f-45f5-b468-6ef61ed1e200

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added the bug Something isn't working label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner

Thank you — this is landing as #1134 in the stacked campaign, with your authorship preserved (the commit on that branch is authored by you, cherry-picked, not rewritten).

The absence-only framing is what makes this safe on a credential path: the sweep is skipped only when both the stage registry and the staging tree are provably absent, and anything present-or-unreadable still enters the locked fail-closed cleanup. Your regression test pinning both directions is the part that earns the change — a fast path that only proved the happy case would not have been adoptable here.

Verified on the stack head: tests/native-profile-stage-lifecycle.test.ts, tests/codex-auth-context.test.ts, tests/native-profile-drain-server.test.ts — 51 pass / 0 fail; typecheck clean; privacy scan green; full suite passed the prepush gate.

Leaving this PR open for you to close or continue.

@lidge-jun

Copy link
Copy Markdown
Owner

Landed on dev — closing as merged-via-stack.

Your commit is in dev with your authorship intact: fix(codex): skip empty native-profile stage sweeps, authored by Ingwannu, carried by #1134 (merge commit 5ba0c1857).

Closing because the work shipped, not because it was rejected. The "closed" label is an artifact of the commit travelling through the campaign branch; the contribution and the credit are on dev.

The absence-only framing is what made this safe to take on a credential path — the sweep is skipped only when both the stage registry and the staging tree are provably absent, and anything present-or-unreadable still enters the locked fail-closed cleanup. Your regression test pinning both directions is what earned it.

Verified: 9,593 pass / 0 fail on the merged tree; CI green on the exact dev SHA. Issue #1120 stays open for @MarcusNeufeldt to confirm on his own installation.

@lidge-jun lidge-jun closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants