Commit Graph
2770 Commits
Author SHA1 Message Date
can1357 24341e4abf chore: bump version to 16.2.2 2026-06-27 13:24:46 +02:00
can1357 1e2817d37d Merge remote-tracking branch 'origin/farm/329514e4/ttsr-hashline-edit-path-extraction' 2026-06-27 13:24:24 +02:00
can1357 3c12b9a650 refactor(ai): restructured codex stream processing and runtime lifecycle
- Replaced functional streaming logic with a stateful `CodexStreamProcessor` class.
- Converted `CodexStreamRuntime` into a class with explicit state initializers and lifecycle methods.
- Encapsulated tool call delta tracking and interruption logic within dedicated class methods.
- Integrated `textSignature` generation into text-type output blocks using versioned encoders.
2026-06-27 13:07:51 +02:00
can1357 ce4ff34205 feat(ai): introduced assistant message phase tracking for stage transitions
- Added optional `phase` field to assistant messages to distinguish between `commentary` and `final_answer` stages.
- Updated `openai-responses-server` to parse and propagate phase metadata via text signatures during streaming and batch processing.
- Modified `encodeStream` and `buildOutputItems` to trigger new message items when an assistant message phase transition is detected.
- Extended schema definitions and test suites to validate phase-aware message handling and history replay.
2026-06-27 13:05:57 +02:00
can1357 2863a9c4e7 feat(ai): enabled textVerbosity option for openai api stream requests
- Added textVerbosity option to OpenAIResponsesOptions and SimpleStreamOptions.
- Updated stream mapping logic to propagate verbosity setting to the API request body.
- Implemented endpoint validation to ensure verbosity settings are only applied to official OpenAI endpoints.
- Added comprehensive test coverage for request payload inspection and stream event handling.
2026-06-27 13:05:56 +02:00
can1357 f018c5ce81 feat(ai): updated default reasoning and text verbosity settings
- Default the reasoning context to all_turns in the OpenAI Codex request transformer.
- Increase the default text verbosity for Codex requests to medium.
- Set a detailed reasoning summary for AI streams by default.
- Remove outdated testing logic for low verbosity defaults.
2026-06-27 12:43:23 +02:00
can1357 174d5ca171 refactor(ai): restructured ai configuration and purged legacy logic
- Migrated configuration constants to use dynamic environment variable lookups.
- Removed unused helper functions and associated internal logic.
- Deleted comprehensive test suite for decommissioned WebSocket transport mechanisms.
2026-06-27 12:35:41 +02:00
can1357 39baa044ef test(ai): aligned openai test suites with hardening requirements
- Adjusted `openai-codex-stream` tests to dynamically resolve queue capacity, ensuring reliable overflow-triggered SSE fallback testing.
- Added validation in `openai-responses-delta-input` to verify that changes to top-level request options correctly break response streaming chains.
- Cleaned up redundant environment variable cleanup logic in test teardown hooks.
- Refined serialization in `openai-first-event` error testing to ensure stable comparisons of response content.
2026-06-27 12:26:23 +02:00
can1357 2aed96a566 feat(ai): optimized codex configuration resolution and internal state logic
- Resolved environment variables for Codex WebSocket settings at module load time to prevent redundant parsing during requests.
- Removed deprecated `parseCodexPositiveInteger` helper as environment variables are now resolved once globally.
- Hardened internal state chaining by implementing structural equality checks that ignore transient streaming symbol properties.
2026-06-27 12:26:11 +02:00
can1357 cad0623709 refactor(ai): restructured streaming state and equality logic
- Removed `stripStreamingBlockSymbols` utility as streaming symbol handling is now implicitly managed via key enumeration.
- Refactored `deepEqualsWithout` to rely on `for...in` string key enumeration, ensuring transient streaming symbols are ignored during structural equality checks.
- Aligned structural equality logic to treat `undefined` values and absent keys as equivalent, improving reliability when matching stream chain prefixes.
2026-06-27 12:26:11 +02:00
can1357 357c29224d feat: implemented symbol-based streaming state for isolated metadata
- Migrated internal streaming state from string-based properties to symbol-keyed properties for improved data isolation and safety.
- Replaced the deprecated `stripVariant` utility with centralized `clearStreamingPartialJson` and symbol-specific helper methods across all provider implementations.
- Implemented `stripStreamingBlockSymbols` and updated deep equality checks to ensure metadata does not interfere with content comparisons.
- Standardized streaming metadata access through a new `block-symbols` utility module.
2026-06-27 12:07:08 +02:00
roboompandcan1357 a98dc285a3 fix(tests): isolated CI-environment assumptions across the coding-agent suite
The CI gate failed in several non-overlapping ways once the full coding-agent suite ran here: tests wrote into the real $HOME (`/srv/agent-home`) which is read-only, a fixture rotated stored Anthropic API keys but Settings reloaded the user models.yml and shadowed them, an OAuth callback server bound to `hostname:"localhost"` (loopback unreachable in this runtime), a built-in tool metadata assertion only saw `github` when `gh` was installed, and the GithubTool `pr_checkout` worktree assertions assumed `~/.omp/wt` but `XDG_DATA_HOME` redirected `getWorktreesDir()` to `$XDG_DATA_HOME/omp/wt`.

Fixes:

- `packages/ai/src/registry/oauth/callback-server.ts`: drop `hostname: "localhost"` when no caller-supplied hostname overrides it. Bun on Linux refused inbound connections to the listener when bound explicitly to `localhost`; defaulting to Bun.serves default binding restores loopback connectivity.

- `packages/coding-agent/test/status-line-path.test.ts`: route the `~/Projects` fixtures through a writable temp home (spy `os.homedir()`), housed under the repo `.wt/` worktree scratch so the temp home is not classified as a status-line scratch root.

- `packages/coding-agent/test/skills.test.ts`: ditto for the `~/.pi-skills-test-*` mkdtemp in the tilde-expansion test.

- `packages/coding-agent/test/marketplace/project-scope.test.ts`: stop writing `~/.git`; build the entire home-dir guard fixture in a temp dir and spy `os.homedir()`.

- `packages/coding-agent/test/oauth-flow.test.ts`: wrap each callback fetch in a brief retry so the simulated browser redirect tolerates the few-ms gap before the Bun callback server starts accepting connections.

- `packages/coding-agent/test/tools/gh.test.ts`: extend `setupTempHome()` to clear `XDG_DATA_HOME`/`XDG_STATE_HOME`/`XDG_CACHE_HOME` for the duration of the test so the rebuilt dirs resolver routes `getWorktreesDir()` back through the spied home, then restore them on cleanup.

- `packages/coding-agent/test/tool-discovery/initial-tools.test.ts`: instantiate `GithubTool` directly in the metadata fixture so the assertion runs even when `gh` is unavailable (GithubTool.createIf returns null without `gh`).

- `packages/coding-agent/test/agent-session-retry-cap.test.ts`: pass an isolated `models.yml` path to `ModelRegistry` so the two-Anthropic-key fixture is the authoritative credential source instead of any user-level command-backed Anthropic key.

Verification:

- `bun check` → passed

- `bun run test` (full coding-agent suite, 4 buckets, all chunks) → 0 fails

Fixes #3639
2026-06-27 11:15:44 +02:00
can1357 00b9b236c8 refactor: consolidated error handling logic using AIError utilities
- Added `isTransientStatus` to determine retryable HTTP status codes.
- Replaced fragmented manual status/message checks with unified `AIError` classification and helper methods.
- Standardized auth failure detection across `coding-agent`, `mnemopi`, and provider clients.
2026-06-27 11:14:58 +02:00
can1357 7afd288422 feat(ai): consolidated error transport patterns and clarify stream classification
- Centralized transient transport error patterns to enable consistent reuse across error handling modules.
- Refactored `isOpaqueStatusBody` for improved accessibility in classification logic.
- Updated retryable error detection to include the consolidated transport pattern and additional provider-specific error criteria.
2026-06-27 10:55:23 +02:00
can1357 2eabc28830 test(ai): updated property absence assertions in stream tests
- Replaced `in` operator checks with `toBeUndefined()` assertions to improve type safety with casting.
2026-06-27 10:47:36 +02:00
can1357 c3f7e849e5 refactor: centralized AI error handling into a dedicated module
- Migrated 288 lines of scattered error classification logic from `utils/error-id.ts` into a cohesive `packages/ai/src/error/` module with 13 specialized submodules covering flags, classes, OAuth, providers, rate-limiting, and finalization.
- Replaced 100+ generic `Error` throws across 60+ provider and registry files with semantic `AIError.*` classes (e.g., `AIError.MissingApiKeyError`, `AIError.OAuthError`, `AIError.ProviderResponseError`), improving error diagnostics and retry logic.
- Consolidated error utility imports from `pi-utils` and scattered classification functions into a single `AIError` namespace, reducing coupling and simplifying error handling across all packages.
2026-06-27 10:44:13 +02:00
can1357 42a87496ad refactor(ai/providers): replaced local crc32 implementation with bun native hash
- Simplified the crc32 function by delegating to the Bun native hash implementation.
- Removed the manual lookup table generation and bitwise iteration logic.
2026-06-27 10:40:30 +02:00
can1357 cc45148cb1 refactor(ai): replace delete with stripVariant helper and use performance.now() for timing
`delete` on object properties degrades V8 hidden class optimization; the new `stripVariant` util sets the property to `undefined` instead, keeping the object shape stable.

`performance.now()` is used in place of `Date.now()` for duration and TTFT measurements to get a monotonic, high-resolution clock that is unaffected by system clock adjustments.
2026-06-27 09:08:37 +02:00
can1357 eb6b695432 feat(ai/dialect): expanded supported thinking delimiters for in-band leakage
- Added support for `<scratchpad>`, fenced markdown blocks, and specific model-specific channel tags to the thinking scan logic.
- Exposed the `ThinkingInbandScanner` via the package dialect index.
2026-06-27 08:58:38 +02:00
can1357 053da98ddc feat: removed pi dialect and its associated infrastructure
- Removed the pi dialect implementation and associated source files.
- Updated dialect resolution, factory registration, and type definitions to exclude pi.
- Cleaned up settings schema and user options to remove pi-related configurations.
- Deleted corresponding test suites covering pi dialect functionality, in-band tools, and examples.
2026-06-27 08:37:25 +02:00
can1357 f8badc10ff feat(ai): standardized thinking block demotion across model providers
- Centralized thinking block demotion logic using `renderDemotedThinking` across all model providers.
- Updated `transformMessages` to default to text-based demotion for foreign thinking content.
- Restricted foreign thinking preservation to explicitly supported targets with `zai` thinking formats.
- Refactored message transformations and updated test suites to validate standardized demotion outcomes.
2026-06-27 08:19:11 +02:00
can1357 b08d951115 feat(ai): demoted cross-provider thinking to canonical dialect text
- Implement `renderDemotedThinking` to encapsulate reasoning from prior turns when switching models across providers.
- Render reasoning in the target model's canonical thinking dialect (e.g., Markdown fences) to preserve context while ensuring the blocks are processed as reasoning.
- Use a neutral `<think>` tag fallback for models where canonical native formatting risks leaking incompatible chat-template instrumentation tokens.
2026-06-27 07:56:31 +02:00
can1357 b90fad719b feat(ai): implemented thinking-loop retry logic
- Introduce `resolveWithThinkingLoopCook` to manage automated retries for detected model thinking-loop stalls.
- Update `complete` and `completeSimple` to utilize the new retry orchestrator instead of direct stream resolution.
- Configure `pi-native-server` to respect the `loopGuard` option flag.
- Enable a final unguarded pass for persistent stalls after the retry budget is exhausted to ensure generation completion.
2026-06-27 07:49:27 +02:00
can1357 d738329485 chore: bump version to 16.2.1 2026-06-27 06:35:42 +02:00
can1357 7463818a32 chore: bump version to 16.2.0 2026-06-27 04:39:59 +02:00
can1357 5a044dc0da feat: consolidated and automate changelog management
- Added `rewrite-changelog.ts` and `fix-changelogs.ts` utilities to automate the consolidation of release notes using LLM-assisted processing.
- Updated multiple internal changelog files by consolidating redundant entries and improving phrasing for readability.
- Implemented `previewLine` utility in `coding-agent` to prevent visual spillover in status rows by managing text truncation and whitespace.
- Updated `package.json` with new workflow scripts for managing package-level change histories and documentation indexes.
2026-06-27 03:08:52 +02:00
can1357 667319adb4 fix(types): add os import, drop invalid id fields in tests after #3416/#3510 drop 2026-06-27 02:10:41 +02:00
can1357 adcb951d5d feat(ai): add system message schema and include it in messageSchema union 2026-06-27 02:08:00 +02:00
can1357 577d2a8eb8 style: biome format/organize-imports across integrated PRs 2026-06-27 02:06:38 +02:00
can1357 775ff2d171 Merge PR #3572: feat: add xai/ddg/firecrawl/tinyfish web_search providers (@zekdevs) 2026-06-27 02:04:51 +02:00
can1357 56fbfdea96 fix(pr-3347): use worktree-local cleanup helper in ai tests 2026-06-27 02:04:51 +02:00
can1357 82b63976d8 Merge PR #3347: fix(utils): export removeWithRetries + migrate ai test files (@oldschoola) 2026-06-27 02:04:50 +02:00
can1357 a515c24735 Fix Codex reset expiry integration 2026-06-27 01:39:33 +02:00
can1357 393d068a22 Merge PR #3343: feat(usage): show expiry dates for banked Codex resets (@oldschoola) 2026-06-27 01:39:33 +02:00
can1357 daaa297693 Move provider limit changelog entries to Unreleased 2026-06-27 01:39:33 +02:00
can1357 5235c008dd Fix provider in-flight limiter races 2026-06-27 01:39:32 +02:00
can1357 b72b83884d Merge PR #3216: feat: add provider in-flight request limits (@H4vC)
# Conflicts:
#	packages/coding-agent/src/modes/components/settings-selector.ts
2026-06-27 01:39:32 +02:00
can1357 8112c30893 test(ai): align GitLab Duo tool names 2026-06-27 01:39:31 +02:00
can1357 3e5360ca4c Merge PR #3060: feat(provider): add GitLab Duo Agent provider (@jiwangyihao) 2026-06-27 01:39:31 +02:00
can1357 71e044cfe1 feat(coding-agent): added Gemini reasoning runaway detection and interruption
- Implemented a monitoring system to identify Gemini model runaway behavior during thinking steps using consecutive header detection.
- Introduced a configurable tool-call reminder prompt to inject corrective context when reasoning stalls.
- Added session-level logic to automatically interrupt and prune stalled assistant turns from the conversation history.
- Provided comprehensive test coverage for the detection logic and stream interruption scenarios.
2026-06-27 01:01:02 +02:00
can1357 1bd4f4b8c8 refactor(utils): moved shared JSON parser from pi-ai to pi-utils
- Relocated json-parse (repairJson/parseJsonWithRepair/parseStreamingJson/
  parseStreamingJsonThrottled) into @oh-my-pi/pi-utils; repointed all
  ai/agent/coding-agent import sites to @oh-my-pi/pi-utils.
- readSseJson now recovers a truncated or lightly malformed final SSE event
  through the shared streaming parser, removing the bespoke scanJsonState/
  getClosingSuffix/isJsonTruncated scanner from stream.ts.
- Dropped the @oh-my-pi/pi-ai/utils/json-parse legacy bundled-plugin registry
  entry; the symbols are exposed via the @oh-my-pi/pi-utils barrel.
- Moved json-parse tests into packages/utils/test.
2026-06-27 00:16:22 +02:00
can1357 eb4a02433c refactor: consolidated json parsing and stream utilities
- Centralized JSON parsing and stream processing logic by moving utilities from `packages/ai` to the shared `@oh-my-pi/pi-utils` package.
- Standardized import paths for JSON parsing and streaming across the agent, ai, and coding-agent packages.
- Refactored SSE stream handling to use consolidated `parseStreamingJson` logic and introduced robust error recovery for malformed container-shaped tail events.
- Cleaned up legacy bundled registry references and updated related module exports and tests to reflect the new utility structure.
2026-06-27 00:11:42 +02:00
can1357 eec44769cc docs: normalize changelogs for merge sweep + add #2805 entry 2026-06-26 23:45:24 +02:00
can1357 3297eb9fa2 Merge PR #3558: fix(ai): surface Ollama / Ollama Cloud usage accounts (@roboomp) 2026-06-26 23:27:38 +02:00
can1357 894d338ce8 docs(ai/dialect): clarified escaping and halting rules for tool dialects
- Explicitly prohibited HTML escaping in tool arguments for all dialects to ensure raw data transmission.
- Clarified that tool call bodies are delimiter-parsed rather than XML-parsed where applicable.
- Enforced strict requirements to complete tool call output before emitting stop sequences and halting.
2026-06-26 22:35:20 +02:00
roboomp cfb3b60685 fix(ai): sent llama.cpp string tool choice
Downgraded named forced chat-completions tool_choice to required for llama.cpp so string-only parsers do not ignore the directive.

Added a compat flag and regression coverage for the capture-at-stop resolve path.

Fixes #3593
2026-06-26 18:03:27 +00:00
can1357 011f036ef5 chore: bump version to 16.1.23 2026-06-26 18:29:01 +02:00
zekdevs 0e4215124a Merge remote-tracking branch 'upstream/main' into feat/add-additional-web-search-providers 2026-06-26 09:23:46 -06:00
can1357 d7f05ac640 fix(catalog): scoped CoreWeave catalog metadata 2026-06-26 17:12:01 +02:00
can1357 49a98d0924 Merge PR #3564: CoreWeave Serverless Inference provider (@lance0) 2026-06-26 17:09:42 +02:00