refactor(codex): keep app-server client internals private#10035

merged1
main
t3code/knip-codex-client-internals
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

Knip reports seven unused values and one unused type in the private Codex app-server package. The plain-stdio layer has no callers; production providers, the probe script and client tests use the child-process layer.

Remove that unused layer and an unused type alias. Make the client constructor, internal error schemas/types and JSON-RPC error schema private. Keep the active child-process layer, wire behavior, error diagnostics and generated upstream definitions unchanged. No tests are removed.

Verification: the package export audit goes from eight findings to zero. All 35 package tests pass before and after; 79 tests pass when including the server Codex provider and session runtime suites. Package typecheck, targeted lint, formatting and diff checks pass. The retained tests exercise real mock-peer requests, notifications, stderr draining and error diagnostics. No visual change.

This is the cleanup layer beneath the new CI export gate. Left unmerged for maintainer review.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Note

Remove unused exports from effect-codex-app-server client internals

  • Removes named exports for JsonRpcError schema in shared.ts and CodexAppServerClient.make/CodexAppServerClient.layer in client.ts
  • Removes named exports for several schemas, types, and an interface in errors.ts: CodexAppServerRequestOperation, CodexAppServerSchemaIssueKind, CodexAppServerSchemaIssueDiagnostics, CodexAppServerPayloadKind, and CodexAppServerProtocolMessageField
  • All definitions remain unchanged within their modules; only the export keyword is removed
  • Risk: any out-of-tree consumers importing these symbols by name will fail to compile until updated

Macroscope summarized b6c854d.

Added 1 commit

  • refactor(codex): keep app-server client internals privateb6c854d
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.5 KiB13.6 KiB+72 B (+0.5%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB−2 B (−0.0%)7.3 KiB✅
CodexLive turn WebSocket wire6.5 KiB6.6 KiB+74 B (+1.1%)7.8 KiB✅
CodexLive turn WebSocket decoded57.0 KiB57.1 KiB+88 B (+0.2%)66.4 KiB✅
CodexLive turn messages810+2 (+25.0%)21✅
ClaudeTotal thread wire13.5 KiB13.6 KiB+10 B (+0.1%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB+3 B (+0.0%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB+7 B (+0.1%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB+44 B (+0.1%)66.4 KiB✅
ClaudeLive turn messages89+1 (+12.5%)21✅

Baseline: eced382 · PR result: b6c854d · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Approved at b6c854d

Macroscope's review found this PR approvable — This is a small private-package cleanup that removes unused exports and an unused plain-stdio layer while preserving the active child-process client and all protocol/runtime behavior. No product defaults, production infrastructure, sensitive code, or static-analysis suppressions are changed.

You can add or adjust custom eligibility rules. Learn more.