Repository navigation
Fix main lint: move native-chat adapter error classes into their own file - #33046
Conversation
…ct file Main's static lint failed max-lines (303 of 300) on structured-agent-session-adapter.ts after #28051 merged. The adapter's error classes move to structured-agent-session-adapter-errors.ts and are re-exported, so every importer is unchanged.
|
No actionable comments were generated in the recent review.
|
|
Main's static check was failing because the native-chat adapter contract exceeded the 300-line limit after #28051. This PR restores the check by moving unchanged error declarations to a separate module and retaining their existing import paths. Chat behavior is unchanged. One adversarial light-path review completed on Verification: 55 tests passed in four named files through tc-gate, covering refusal details, processless acquisition, prompt cancellation, and Codex prompt answers. Exact-head CI is green: 23 successful checks, 17 skipped, including static analysis/typecheck, all five unit-test shards, cross-version compatibility, and packaging. QA is Reference comparison: no mechanism changes—value sources, refusal conditions, ownership, and all error consumers are unchanged. The move introduces no behavioral difference from the common pattern; For Brennan's review: unchanged declarations and preserved public exports. Readiness check: |
Problem
Since #28051 merged, main's static lint check fails for every PR:
src/main/native-chat/agent-session-wire/structured-agent-session-adapter.tscounts 303 lines against the 300-linemax-lineslimit. #28051 passed on its own branch; together with main's changes since, the file went over.Change
The adapter's error classes (
AgentSessionAcquisitionRefusal,AgentSessionPromptUnavailableError,AgentSessionPromptAnswerRejectedError,AgentSessionPreSpawnError,isAgentSessionPreSpawnErrorand theAgentSessionPreSpawnReasontype) move unchanged intostructured-agent-session-adapter-errors.ts. The adapter file re-exports them, so no importer changes and nothing behaves differently. No lint rule is disabled.No user-facing change. CI is the check: static analysis, typecheck and the unit tests that import these classes.
Author: @BrennanKB5
Plan
Move the existing error declarations into one dependency-leaf module and re-export the same values and type from the adapter contract. Verify the declarations are byte-for-byte unchanged, every import still resolves, the split creates no runtime cycle, and static analysis and tests pass. No lifecycle, refusal, persistence, wire, or user-facing behavior changes.
Light-path classification (explicitly requested for this pure move):
qa=tests); there is no changed user flow requiring a real-app run.