Skip to content

fix(ci): remove unused catalog and agent exports - #201320

Closed
vincentkoc wants to merge 2 commits into
mainfrom
fix/knip-private-client-floor-20261118
Closed

vincentkoc wants to merge 2 commits into
mainfrom
fix/knip-private-client-floor-20261118

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The full validation dependency check fails on an internal OpenAI version constant and an unused UI re-export.

User Impact

No user-visible behavior changes. This restores the intended private module boundaries so the dependency check can pass.

Why This Change Was Made

Keep the Codex fallback floor private and give catalog tests explicit fixture versions instead of importing that implementation value. The existing contract still checks the fallback against the bundled Codex pin. Remove only the unused agent-watcher barrel export; the production helper and its direct caller remain unchanged. Keep each existing mock-isolation rationale immediately above its mock so the repository ratchet recognizes the intentional npm-lookup isolation.

Evidence

  • Main validation failure reproduced on the frozen base: two production exports and one full-tree export. Candidate script, production, and full-tree Knip reports all pass.
  • All five touched OpenAI test files pass (56 tests); the bundled Codex pin contract passes. Node 24.22.1 and the repository-pinned Bun runtime, with private frozen dependencies.
  • Format and typed lint pass for all eight files. The selected OpenAI package compile, UI typecheck, and owning root-scripts test typecheck pass.
  • No focused extension-test typecheck selector exists; the broader extension test graph is left to PR CI. An initially overbroad root-type selector was stopped; the correct root-scripts leaf passed.
  • The first PR attempt exposed four split mock-isolation comments in the mock-factory ratchet. The exact local ratchet reproduced all four failures; joining each existing rationale onto one adjacent line passes the same ratchet. Formatting passes for all four corrected files. Runtime proof remains valid because the correction changes comments only.
  • Fresh local ClawSweeper review of 0aafe669..f948120c found no correctness or security issues (confidence 0.93).

@vincentkoc vincentkoc self-assigned this Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 18, 2026 16:06
@vincentkoc
vincentkoc enabled auto-merge (squash) November 18, 2026 16:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR makes the Codex fallback constant private, replaces test imports with explicit fixtures, and removes an unused UI re-export.

Example: ChatGPT catalog discovery runs while npm is unavailable.

  • Before: Discovery falls back to Codex version 0.169.0.
  • After: Discovery still falls back to 0.169.0; the constant is private.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The cleanup is focused and behavior-preserving, but an introduced mock-export check failure prevents a passing verdict.
Proof confidence 🐚 platinum hermit (4/6) This cleanup changes internal exports and test fixtures without changing user-visible runtime behavior, so shipped-entry-point proof is not required.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Repository validation rejects implementation details exposed as unused exports.
Reason: The maintainer-authored direction is established, and the cleanup preserves runtime behavior while reducing internal coupling.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored cleanup is useful, but four replacement mocks introduce a source-check failure that blocks merge.

Priority: P2
Reviewed head: b60a469a71d3773e15742b86f65cad4a157ddaaf

Before merge

  • Place isolation annotations immediately above the closed mocks (P2) - Replacing the pass-through factories with closed factories makes them subject to the isolation exception in scripts/lib/mock-factory-scan.mts. That exception inspects only the immediately preceding line, which currently reads // covered by openai-codex-discovery.test.ts. rather than starting with // mock-isolation:. Consequently these new factories are rejected by pnpm check:test-mock-exports; exact-head baseline-ratchets CI reports mock-exports failed. Put the recognized annotation immediately above each mock in openai-api-key-catalog.test.ts, openai-provider.codex-catalog.test.ts, openai-provider.test.ts, and platform-access-programs.test.ts.

Findings

  • [P2] Place isolation annotations immediately above the closed mocks — extensions/openai/openai-api-key-catalog.test.ts:9-11
Agent review details

How this fits together

The OpenAI plugin resolves the client version used for subscription model discovery, while the UI agent module exposes roster operations; this cleanup narrows internal exports and adjusts their tests.

flowchart LR
  A[Catalog discovery] --> B[Client version resolver]
  B --> C[npm registry]
  B --> D[Private bundled floor]
  E[Sessions controller] --> F[Selected agent watcher]
  G[Source checks] --> H[Exports and test mocks]
Loading

Technical review

Best possible solution:

Keep the narrow export cleanup and place a recognized isolation annotation immediately above each of the four replacement mocks.

Do we have a high-confidence way to reproduce the issue?

Source inspection establishes why the four closed mocks fail the guard, and exact-head CI independently reports mock-exports failed; no target code was executed during this review.

Is this the best way to solve the issue?

The existing resolver and watcher remain the correct owners, and explicit test fixtures remove unnecessary exports without adding machinery.

Full review comments:

  • [P2] Place isolation annotations immediately above the closed mocks — extensions/openai/openai-api-key-catalog.test.ts:9-11
    Replacing the pass-through factories with closed factories makes them subject to the isolation exception in scripts/lib/mock-factory-scan.mts. That exception inspects only the immediately preceding line, which currently reads // covered by openai-codex-discovery.test.ts. rather than starting with // mock-isolation:. Consequently these new factories are rejected by pnpm check:test-mock-exports; exact-head baseline-ratchets CI reports mock-exports failed. Put the recognized annotation immediately above each mock in openai-api-key-catalog.test.ts, openai-provider.codex-catalog.test.ts, openai-provider.test.ts, and platform-access-programs.test.ts.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 62f44bc09d97.

Provenance checked

  • OpenAI client-version resolver and catalog fixtures keeps the original intent (1680f54: Discover newly published subscription models while retaining the bundled Codex version as the offline floor.)
  • Selected-agent watcher barrel export keeps the original intent (d526a02: Move the Sessions observer into the agents module while refreshing automation models independently of page scope; the remaining Sessions consumer imports the helper directly.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-mock-exports
  • pnpm test extensions/openai/openai-api-key-catalog.test.ts extensions/openai/openai-provider.codex-catalog.test.ts extensions/openai/openai-provider.test.ts extensions/openai/platform-access-programs.test.ts
  • git diff --check
  • Verify exact-head checks-fast-baseline-ratchets succeeds.

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 1680f54 adds extensions/openai/codex-client-version.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1680f5450480; files: extensions/openai/codex-client-version.ts)

PR surface

Source -1, Tests -15. Total -16 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 1 2 -1
Tests 6 16 31 -15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 17 33 -16

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This restores repository validation without changing product behavior, but needs a small repair for an introduced source-check failure.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This restores repository validation without changing product behavior, but needs a small repair for an introduced source-check failure.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 11:21 AM ET / 16:21 UTC.

@vincentkoc
vincentkoc disabled auto-merge November 18, 2026 16:53
@vincentkoc

Copy link
Copy Markdown
Member Author

Superseded by c9f03ee. That commit makes the same OpenAI fallback floor private, removes the same unused agent-watcher export, and updates the existing pin contract. It uses the canonical bundled-package pin in its test fixtures.

Closing this duplicate instead of replacing the landed fixture approach. This branch’s corrected checks passed, and its earlier auto-merge request was retired before the correction; no merge is requested here.

@vincentkoc vincentkoc closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui extensions: openai P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant