Commit Graph

9 Commits

Author SHA1 Message Date
can1357 56fbfdea96 fix(pr-3347): use worktree-local cleanup helper in ai tests 2026-06-27 02:04:51 +02:00
oldschoola e17f692af7 test(ai): migrate 24 test files from fs.rm to removeWithRetries
Batch-migrated all packages/ai/test/ files that used fs.rm/fs.rmSync
directly to use removeWithRetries/removeSyncWithRetries from
@oh-my-pi/pi-utils. This fixes EBUSY failures on Windows where SQLite
database files are still locked by the process when afterEach cleanup
hooks run.

Files migrated (24 total):
- 5 auth-broker test files (auth-broker-*.test.ts)
- 11 auth-storage test files (auth-storage-*.test.ts)
- 4 non-auth test files (aws-credentials, issue-1417, issue-957, model-cache)
- 3 remaining test files (remote-auth-store, request-debug, stream)
- 2 sync migration files (anthropic-alignment, image-limits)

Total: 28 fs.rm/fs.rmSync calls replaced with retry-enabled versions.
The retry logic: 40 retries, 25ms delay, EBUSY/EPERM/ENOTEMPTY on Windows.
2026-06-23 12:43:23 -07:00
can1357 4d96bcf6b6 feat: replaced manual debug request path with automated llm dump
- Replaced the `/debug dump-next-request` command with an updated `/dump` command that exports LLM request context to JSON sidecar files.
- Removed persistent debug path state and manual path configuration in favor of automated generation.
- Updated session logic to handle serializing LLM request context to temporary directories.
- Refactored testing suites to remove path-based debug tests and verify dynamic request file generation.
2026-06-21 03:18:20 +02:00
can1357 0e049b9a1a test(ai): dropped chdir and env mutation from request-debug recording test
- Replaced `process.chdir(tempDir)` plus `PI_REQ_DEBUG=1` auto-naming with explicit `setNextRequestDebugPath` targets, removing the `previousCwd` save/restore and the `debugFiles` directory-scan helper.
- The PI_REQ_DEBUG recording assertions now read each request/response from the path they set, so the test no longer mutates `process.cwd()` or the global debug env flag.
2026-06-17 01:22:31 +02:00
can1357 99c9072427 feat: added one-shot AI request dump path support for debug workflows
- Added explicit request-debug path helpers in `packages/ai/src/utils/request-debug.ts` for one-shot dumps.
- Added `/debug dump-next-request`, `/debug dump-request`, and `/debug next-request` subcommands to arm next-request dumps.
- Changed `debug` handling in `packages/coding-agent/src/slash-commands/builtin-registry.ts` to execute args instead of always opening selector.
- Fixed explicit request-debug mode to resolve `~`/relative paths and create parent directories before logging.
- Fixed one-shot request-debug mode to consume its target after one call and overwrite existing response logs.
2026-06-12 04:46:53 +02:00
can1357 ae415199dc feat: added build-time compatibility in ModelSpec/buildModel pipeline
- Centralized catalog and registry handling on `ModelSpec` and `buildModel`, resolving compatibility at model build time.
- Removed runtime compatibility detectors and switched provider request flows to direct `model.compat` reads.
- Added compat fields (`supportsReasoningParams`, `alwaysSendMaxTokens`, `strictResponsesPairing`, `whenThinking`).
- Persisted explicit compatibility overrides through `compatConfig` in discovery and cache merge paths.
2026-06-10 06:20:51 +02:00
can1357 eb1a46baf5 feat: added injectable fetch transport across AI and coding network flows
- Added optional FetchImpl fields to compaction, proxy, AI, coding-agent, and mnemopi options.
- Threaded injected fetch implementations through OAuth, discovery, and search/LLM request flows.
- Removed exported hookFetch utility and its package entrypoint from utils.
- Replaced global-fetch test monkeypatching with per-test FetchImpl mocks across test suites.
2026-06-09 04:51:17 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 b7ee6bf656 feat(ai): added PI_REQ_DEBUG request/response recording for transports
- Added `wrapFetchForRequestDebug` to intercept fetch calls and write `rr-session-N.json` (request) and `rr-session-N.res.log` (response headers + raw body) when `PI_REQ_DEBUG=1`.
- Integrated debug fetch wrapping into `stream` and `streamSimple` entry points so all providers inherit recording automatically.
- Extended Cursor HTTP/2 and Codex WebSocket transports with explicit debug session hooks for non-fetch protocols.
- Added `fetch` field propagation through `mapOptionsForApi` and Bedrock options so the wrapped fetch reaches every provider.
2026-05-30 04:34:44 +02:00