# refactor\(codex\): keep app-server client internals private · PR \#10035 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10035)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: t3code/knip-codex-client-internals

Target branch: main

Head commit: b6c854dd6a596bf060b43f8611c60f0729367b37

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/10035)

[Commits](https://git.cafe/pingdotgg/t3code/pull/10035/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/10035/diffs?format=markdown)

## Description

---

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.


<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Remove unused exports from `effect-codex-app-server` client internals
> - Removes named exports for `JsonRpcError` schema in [shared.ts](https://github.com/pingdotgg/t3code/pull/10035/files#diff-082b3e69a506286c6688439b14dd2ee72dffcd995aeb34fd03f517ac162e4d5a) and `CodexAppServerClient.make`/`CodexAppServerClient.layer` in [client.ts](https://github.com/pingdotgg/t3code/pull/10035/files#diff-3d60ac4e051da962d4a1e6f4bd881857f81b3f5ead25e9cf52ac0be96924b717)
> - Removes named exports for several schemas, types, and an interface in [errors.ts](https://github.com/pingdotgg/t3code/pull/10035/files#diff-15f2438678486824c3e9f879f76d63b1a379a3d8ed1df47fac0fdd40b9c6de0c): `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's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized b6c854d.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->
