Commit Graph
23 Commits
Author SHA1 Message Date
BogdanandGitHub 4e56fd5921 [codex] perf(skills): cap skill listing budget (#1627)
* perf(skills): cap skill listing budget

* chore(skills): export listing budget options
2026-06-15 08:44:53 +08:00
BogdanandGitHub 3752dfe6f7 fix(typecheck): recreate missing CLI Transport interface (#1581)
* fix(typecheck): recreate missing CLI Transport interface

* fix(transports): implement async close in CLI transports

* fix(transports): harden async close cleanup

* fix: address async transport close review feedback

* test: isolate environment-sensitive suites

* fix(transports): drain uploader after close failure

* fix(transports): type guard CCR stream events

* test: remove unused auto-compact fixture helper
2026-06-12 15:17:56 +08:00
BogdanandGitHub bb19392e69 fix(typecheck): expand cachedMicrocompact stub exports (#1591)
* fix(typecheck): expand cachedMicrocompact stub exports

The cachedMicrocompact module is a feature-gated stub that only exported
3 functions, but microCompact.ts expected 10+ exports including types and
state management functions.

Changes:
- Add missing type exports: CachedMCState, CacheEditsBlock, PinnedCacheEdits, CachedMCConfig
- Add missing function stubs: createCachedMCState, markToolsSentToAPI, resetCachedMCState, registerToolResult, registerToolMessage, getToolResultsToDelete, createCacheEditsBlock
- Add null guard in cachedMicrocompactPath for config
- Add comprehensive tests for stub behavior

Resolves 15 typecheck errors in microCompact.ts:
- TS2694: Namespace has no exported member (10 errors)
- TS2339: Property does not exist (5 errors)
- TS18047: possibly null (2 errors)

Testing:
- bun test src/services/compact/cachedMicrocompact.test.ts: 7/7 pass
- bun test src/services/compact/: 61/61 pass
- bun run smoke: pass
- Typecheck errors: 697 → 682 (-15)

* fix(typecheck): address CodeRabbit review feedback

- Add missing fields to CachedMCConfig type: enabled, supportedModels,
  systemPromptSuggestSummaries (used by prompts.ts and claude.ts)
- Replace silent fallback with explicit error throw in cachedMicrocompactPath
  to enforce the invariant that isCachedMicrocompactEnabled() === true implies
  getCachedMCConfig() !== null, preventing potential recursion in future
  non-stub implementations

* test: prevent CI state leaks
2026-06-10 21:56:01 +08:00
BogdanandGitHub 794ccd4f9e fix(typecheck): correct fetch mock type casts in test files (#1592)
* fix(typecheck): correct fetch mock type casts in test files

Test files were casting mock functions to 'typeof fetch' but the mock
signatures didn't match the full fetch type (missing init parameter,
wrong return type, etc.), causing TS2352 errors.

Changes:
- Use double-cast pattern: 'as unknown as typeof fetch' or 'as unknown as FetchType'
- Remove unused @ts-expect-error directive in providerDiscovery.test.ts
- Applied consistently across 6 test files

Files modified:
- src/utils/providerDiscovery.test.ts (11 errors fixed)
- src/services/api/openaiShim.test.ts (9 errors fixed)
- src/tools/firecrawl/client.test.ts (5 errors fixed)
- src/utils/apiPreconnect.test.ts (4 errors fixed)
- src/services/api/codexOAuth.test.ts (2 errors fixed)
- src/services/api/fetchWithProxyRetry.test.ts (1 error fixed)

Testing:
- bun test [all 6 files]: 154/154 pass
- bun run smoke: pass
- Typecheck errors: 682 → 664 (-18)

* chore: trigger CI re-run (flaky test investigation)
2026-06-10 21:55:14 +08:00
BogdanandGitHub 9db9427f29 fix(typecheck): reduce error baseline by 89 across 8 files (#1595)
* fix: resolve 28 typecheck errors in openaiShim.ts

Add null guards for nullable `reader`, `response`, and `responsesResponse`
variables, and use type assertions to bridge Node vs Web ReadableStream
type mismatches in stream processing helpers.

* fix(typecheck): resolve 17 errors in agentSdkTypes.ts

- Add @ts-expect-error for settingsTypes.generated.js (generated at build time)
- Fix type imports: redirect 5 types from ./sdk/runtimeTypes.js to ./sdk/shared.js
- Remove 11 unused type imports that don't exist (AnyZodRawShape, InferShape, etc.)

* fix(typecheck): resolve 26 errors in openaiShim.ts — nullable guards, ReadableStream types

* fix(typecheck): resolve 23 errors in messages.ts + groupToolUses.ts

MessageWithoutProgress resolved to `never` because all message types are
`any` stubs, making `Exclude<any, any>` = `never`. Widen types and use
boolean wrappers to avoid type-predicate narrowing. Add missing return
in getToolUseID switch statement.

* fix(typecheck): resolve 14 errors in toolExecution.ts — fix never[] inference

* fix(typecheck): resolve type errors in claude.ts

- Cast nested block params to BetaContentBlockParam for SDK type union mismatch
- Add missing CACHE_EDITING_BETA_HEADER constant to betas.ts
- Type-assert getCachedMCConfig() return for supportedModels access
- Add missing imports: getContextWindowForModel, COMPACT_MAX_OUTPUT_TOKENS, getSdkBetas
- Fix model variable reference to use options.model in compact context
- Add optional signature property to ConnectorTextBlock type

* ci: re-trigger checks

* fix: address CodeRabbit review feedback

- Throw error instead of silent return when response body is not readable
- Clamp hybrid context budget to non-negative floor (Math.max(0, ...))
- Remove unused isResult wrapper in messages.ts
2026-06-10 21:54:37 +08:00
60b7215785 chore(tests): fix flaky and environment-dependent unit tests (#1582)
* chore(tests): fix flaky and environment-dependent unit tests

- Mock fs.existsSync in geminiAuth tests to prevent real ADC reads
- Isolate runtimeMetadata tests from local environment variables
- Add shared mutation lock to sessionStorage tests to prevent env race conditions

* test: address environment cleanup review

* test(autoCompact): guard temp-dir cleanup against setup-time failures

If beforeEach throws before tempDir is assigned (e.g. lock acquisition or
mkdtempSync fails), afterEach's unconditional rmSync(tempDir) threw a
TypeError and masked the original failure. Type tempDir as string | undefined
and skip removal when unset, mirroring the savedAutoCompactEnabled reset.

Addresses CodeRabbit review on PR #1582.

Co-Authored-By: OpenClaude <openclaude@gitlawb.com>

---------

Co-authored-by: Kevin Codex <kevin@gitlawb.com>
Co-authored-by: OpenClaude <openclaude@gitlawb.com>
2026-06-10 09:46:54 +08:00
BogdanandGitHub 553342c204 fix(typecheck): recreate missing Spinner types (#1579) 2026-06-10 09:04:19 +08:00
BogdanandGitHub fba949cabf fix(typecheck): type FileWrite rejection state (#1574) 2026-06-10 09:01:57 +08:00
BogdanandGitHub e6ce1037fe refactor(open-build): remove Ant employee gates (#1576)
* refactor(open-build): remove Ant employee gates

* fix(open-build): address gate-removal review feedback

* fix(open-build): address follow-up review findings

* fix(hooks): remove stale remote fallback status

* fix(open-build): keep pending background tasks visible

* test(open-build): cover task footer hiding
2026-06-10 09:01:26 +08:00
BogdanandGitHub 62c2c5b62f fix(typecheck): recreate missing FeedbackSurvey utils (#1580) 2026-06-10 08:57:00 +08:00
BogdanandGitHub 7727a9f3a3 fix(typecheck): narrow remote agent SDK logs (#1573) 2026-06-10 08:55:32 +08:00
BogdanandGitHub c2cc6ed333 fix(typecheck): type gRPC stream messages (#1572) 2026-06-10 08:54:54 +08:00
BogdanandGitHub 38b2d83699 fix(typecheck): declare Ink JSX intrinsics (#1571) 2026-06-10 08:53:52 +08:00
BogdanandGitHub bf2d540efc fix(typecheck): type MCP XAA auth storage (#1570) 2026-06-10 08:53:07 +08:00
BogdanandGitHub 499c702bce fix(typecheck): type stats dialog state (#1569) 2026-06-10 08:50:55 +08:00
BogdanandGitHub e53d612da5 fix(typecheck): annotate diff rendering props (#1568) 2026-06-10 08:50:14 +08:00
BogdanandGitHub 6ee24f78e7 fix(typecheck): tighten permission rule UI types (#1567) 2026-06-10 08:50:03 +08:00
BogdanandGitHub 65034db367 fix(typecheck): add wizard agent creation types (#1566)
* fix(typecheck): add wizard agent creation types

* fix(typecheck): guard agent wizard state
2026-06-10 08:49:03 +08:00
BogdanandGitHub fc0a4b5cdf fix(typecheck): add plugin command view types (#1565)
* fix(typecheck): add plugin command view types

* fix(typecheck): simplify plugin settings update
2026-06-10 08:48:28 +08:00
BogdanandGitHub 548bffc2a7 fix(typecheck): add MCP component view types (#1564) 2026-06-10 08:48:05 +08:00
BogdanandGitHub f129dd0397 fix(typecheck): declare optional native modules (#1563)
* fix(typecheck): declare optional native modules

* fix(typecheck): self-contain computer-use declarations
2026-06-10 08:47:36 +08:00
BogdanandGitHub 5c239eb601 fix(typecheck): declare bundled markdown and macro fields (#1562)
* fix(typecheck): declare bundled markdown and macro fields

* fix(build): define version changelog macro
2026-06-10 08:44:06 +08:00
BogdanandGitHub 491985a618 fix(typecheck): type session storage test fixtures (#1526)
* fix(typecheck): type session storage test fixtures

* fix(typecheck): align snip boundary fixture ids
2026-06-10 08:41:47 +08:00