Commit Graph

127 Commits

Author SHA1 Message Date
can1357 6d2bae2c41 feat: implemented long-context pricing and configuration support
- Added long-context pricing tiers and billing policies for subscription Codex models in the catalog.
- Introduced the `extendedContext` configuration setting to control premium long-context windows.
- Implemented runtime policy refresh and model re-binding when context settings change.
- Added comprehensive unit tests for pricing tiers, context capping, and policy toggling behavior.
2026-08-20 02:47:32 +02:00
can1357 02cd22dc9b feat: added live tracking and stale status warnings for agent activity snapshots
- Added live tracking and stale status warnings for agent activity snapshots.
- Fixed text wrapping with ANSI escape sequences to defer style open sequences after whitespace.
- Added VirtualRenderScheduler for deterministic virtual-clock rendering tests.
2026-08-16 10:18:56 +03:00
can1357 6b4823181b test: cleaned test suites and documented filtering guidelines
- Remove redundant definedness, null, and type checks across test suites in multiple packages.
- Clean up unused assertions, metadata tests, and obsolete test cases.
- Add good versus bad test filter guidelines and requirements to project documentation.
2026-08-13 08:28:42 +02:00
pickpocket e7e280a6fb fix(catalog): complete GPT-5.6 off and pricing support
(cherry picked from commit fc034d61ff69e8ad1870f674c72ff3f761741862)
2026-08-13 02:00:59 +02:00
roboomp 67441e2eec fix(config): bumped openai-models-list discovery cache namespace
Warm context-v2 rows cached before server input-modality parsing pinned vision-capable ids at input: ["text"] until a forced refresh. Bump the namespace to context-v3 so the modality fix takes effect on the next online-if-uncached refresh, and add a regression proving v2 rows are orphaned.
2026-08-04 03:32:06 +00:00
roboomp 2cfaeb6116 fix(catalog): honored openrouter deepseek effort metadata
- Parsed OpenRouter reasoning effort ladders and defaults during discovery.

- Preserved explicit thinking metadata from models.yml patches.

- Regenerated the catalog and covered both regression paths.

Fixes #7307
2026-08-01 19:06:44 +00:00
can1357 c565e6fb44 feat(catalog): migrated model catalog endpoints to stencil.so with ETag and ZStd
- Migrated model catalog fetching and documentation references from the models.dev API to the stencil.so well-known models endpoint.
- Added support for zstd decompression and session-based caching with ETag conditional requests and stale fallback handling.
- Updated test suites, mock URLs, and constants across catalog and coding-agent packages to target stencil.so.
2026-07-31 20:38:49 +02:00
usr-bin-roygbiv 9bab62ee55 fix(computer-use): address routing review gaps 2026-07-25 02:14:36 +00:00
roboomp 87ca331330 fix(coding-agent): preserved compat overrides on model refresh
Merged provider compatibility configuration after dynamic discovery so explicit models.yml fields remain authoritative across refreshes.

Added a regression covering Anthropic unsigned-thinking replay through refreshProvider.

Fixes #6041
2026-07-21 20:16:52 +00:00
roboomp 67ca037b17 fix(ai): allowed custom oauth fingerprint headers
Added an opt-in compatibility flag for non-official Anthropic OAuth endpoints while preserving authoritative OAuth and Cloudflare credentials.

Fixes #5888
2026-07-17 17:44:47 +00:00
can1357 c098e8679d merged PR #5601: fix(web-search): honor configured xAI transport 2026-07-16 03:31:58 +02:00
roboomp 188985eb0f fix(models): isolated provider header defaults
- Resolved provider headers only from static and runtime provider overrides.
- Kept unrelated per-model header overrides out of native tool requests.
- Added regression coverage for xAI model-scoped tenant headers.

Fixes #5599
2026-07-15 17:53:47 +00:00
roboomp 4b3ec660f3 fix(catalog): disabled eager streaming for custom anthropic
Defaulted eager tool input streaming to the canonical Anthropic API while allowing explicit models.yml opt-in for compatible proxies.

Fixes #5572
2026-07-15 11:20:12 +00:00
can1357 68bc6ba605 test(coding-agent): updated thinking model metadata expectations
- Update Ollama discovery tests to reflect the wire effort vocabulary.
- Adjust model registry test expectations to treat adaptive effort ladders as verbatim, removing the legacy effortMap backfilling behavior.
2026-07-10 14:10:41 +02:00
can1357 e64f15eb63 Merge remote-tracking branch 'origin/farm/20bff231/zhipu-glm-coding-plan-auth' 2026-07-02 23:43:10 +02:00
roboomp a86bf4f41b fix(coding-agent): surfaced invalid models config errors
Converted ArkType validation failures into ConfigError results and surfaced models.yml validation failures in CLI model listing and noninteractive startup.

Fixes #4305
2026-07-02 11:58:56 +00:00
roboomp d8c572f2d8 style: bun run fix 2026-07-02 10:12:31 +00:00
roboomp e009c623d8 fix(catalog): restore zhipu coding plan availability
Use the domestic Zhipu Coding Plan default that the login probe validates and make authenticated Zhipu model discovery authoritative so account-scoped model lists remove unavailable bundled fallbacks.

Fixes #4296
2026-07-02 10:12:13 +00:00
can1357 1a2471fa1a fix(catalog): invalidated warm litellm caches after suffix stripping
- Bumped the dynamic-model cache namespace rich-v1 -> rich-v2 in the catalog manager and the coding-agent configured-discovery callsite so the #3717 reseller-suffix mappers reach users with a warm 24h cache.
2026-07-02 00:32:57 +02:00
can1357 ef7636805b feat(coding-agent): removed canonical model variant selection and tracking
- Removed the canonical model variant indexing, selection, and tracking logic from the model registry and resolver.
- Eliminated the `canonical` sub-command, tab view, search tokens, and equivalence configuration structures from the CLI and model selector components.
- Refined model identification, lookup, and provider fallback resolution to bind exclusively to standard, raw model IDs.
- Relocated the equivalence utility script within the catalog package to support script-only policy generation.
2026-07-01 05:22:42 +02:00
can1357 7b1525075a feat(catalog): updated model catalog configurations and pricing
- Added configurations for `anthropic/claude-sonnet-5` under openrouter, vercel-ai-gateway, and zenmux providers.
- Reduced model pricing and cost structure rates for `anthropic/claude-sonnet-5`.
- Removed `trustExplicitThinkingOnly` compatibility flag from several Claude and Gemini model entries.
- Removed legacy `disableStrictTools` property from model definitions and updated tests.
- Fixed model builder variant collapse logic to properly map `compatConfig` to `compat`.
- Sanitized environment variables in git-clone test helpers to avoid host-leakage in test runs.
2026-06-30 20:21:42 +02:00
can1357 f7df67ad72 Merge remote-tracking branch 'origin/farm/df125a92/fix-skill-slash-replace-prompt' 2026-06-30 20:17:24 +02:00
can1357 102d6d54ad feat: implemented v2 streaming remote compaction for model history state
- Introduced V2 streaming remote compaction for OpenAI-compatible models, enabling full conversation history forwarding and reducing data loss from local trimming.
- Added comprehensive support for sessionId, promptCacheKey, and automatic retry mechanisms to improve compaction reliability and accuracy.
- Updated agent, catalog, and configuration schemas to manage V2 streaming settings, model metadata, and model-specific context window constraints.
- Extended freeform tool patch support for Azure OpenAI and Codex models and refined assistant-side history preservation across providers.
2026-06-28 07:27:02 +02:00
can1357 74d7dfd2fa Merge PR #3354: fix: migrate coding-agent tests to removeWithRetries (@oldschoola) 2026-06-27 02:06:38 +02:00
can1357 577d2a8eb8 style: biome format/organize-imports across integrated PRs 2026-06-27 02:06:38 +02:00
can1357 0b8206a46d fix(compaction): preserve provider defaults for remote compaction 2026-06-27 01:39:34 +02:00
can1357 14cc9cba0f Merge PR #3106: fix(compaction): enable custom provider remote compaction (@roboomp) 2026-06-27 01:39:34 +02:00
oldschoola a2854ba768 fix: migrate coding-agent tests from fs.rm to removeWithRetries
Migrate 203 test files (356 call sites) from fs.rm/fs.rmSync to
removeWithRetries/removeSyncWithRetries to reduce EBUSY test failures
on Windows. removeWithRetries is now exported from @oh-my-pi/pi-utils.

The migration uses a regex-based approach that:
- Replaces fs.rm(path, { recursive, force }) → removeWithRetries(path)
- Replaces fs.rmSync(path, { recursive, force }) → removeSyncWithRetries(path)
- Replaces fs.rm(path) → removeWithRetries(path) (no options)
- Skips fs.rm/fs.rmSync inside template literals (bun --eval scripts)
- Adds imports to existing @oh-my-pi/pi-utils import or creates new one
- Removes unused fs imports where fs.rm was the only fs usage (4 files)
2026-06-23 15:28:05 -07:00
roboomp b7aefe0689 fix(compaction): enabled custom remote compaction
- Added provider/model remoteCompaction metadata and models.yml propagation.\n- Routed configured OpenAI-compatible compaction endpoints for custom providers.\n- Added compactionModel as a summary-only model selector that leaves the active session model unchanged.\n\nFixes #3104
2026-06-20 07:27:09 +00:00
Alexander Kirilin eaf9248ec2 fix(catalog): merge main into MiMo efforts 2026-06-20 03:27:05 -04:00
roboomp 48d64210f9 fix(config): allowed responses image detail compat
Added the missing models.yml schema field for compat.supportsImageDetailOriginal so custom Responses-compatible proxies can opt out of snapcompact's native-resolution image hint.

Covered the CC Switch-style custom provider override and the Codex Responses wire clamp from original to auto.

Fixes #3092
2026-06-20 02:27:57 +00:00
Alexander Kirilin 057b39fc46 fix(catalog): resolve MiMo branch conflicts 2026-06-19 20:28:05 -04:00
can1357 052b6b0c61 Merge PR #3006: fix(providers): accept Bedrock inference profile ARNs (@roboomp) 2026-06-19 17:16:18 +02:00
can1357 40101bd3eb Merge PR #3043: fix(catalog): omit Ollama Cloud output caps (@wolfiesch)
# Conflicts:
#	packages/catalog/src/models.json
2026-06-19 17:15:43 +02:00
can1357 d46bd0139b refactor(coding-agent): fixed system prompt customization path
- Fixed `SYSTEM.md` integration to correctly include custom-rendered sections like rules and skills.
- Consolidated system prompt validation by requiring `<skills>` tag presence instead of specific prose.
- Removed redundant system prompt math-formatting tests and orphaned task batch documentation tests.
2026-06-19 16:16:37 +02:00
Wolfgang Schoenberger 99c90a2ef1 fix(coding-agent): normalize cached Ollama Cloud output caps 2026-06-19 03:56:02 -07:00
Wolfgang Schoenberger 409af331e7 fix(catalog): omit Ollama Cloud output caps 2026-06-19 02:51:23 -07:00
roboomp 491fbeb2bb test(providers): covered bedrock profile restore lookup
Added regression coverage for ModelRegistry.find restoring persisted Amazon Bedrock inference profile ARN models through the synthetic resolver path.

Fixes #3004
2026-06-18 22:34:38 +00:00
Alexander Kirilin 0e415efeea test(coding-agent): avoid antigravity cache alias collision 2026-06-18 16:38:22 -04:00
can1357 6385afdfb7 test(coding-agent): replaced Bun.sleep and wall-clock timing
- Replaced Bun.sleep and wall-clock timing with fake timers (vi.useFakeTimers), release gates, and deterministic polling across 15+ test files to eliminate flakiness and improve speed.
- Consolidated per-test fixture setup into beforeAll/afterAll lifecycle hooks across 20+ test files, reducing redundant initialization and improving test performance by reusing shared immutable fixtures.
- Stubbed network calls in ModelRegistry and test discovery to prevent unintended outbound requests during test execution.
- Replaced subprocess-based test coordination (file markers, Bun.sleep polling) with in-memory fakes (FakeWebSocket, FakeLspServer, VirtualClock) for deterministic, fast test execution.
2026-06-15 11:48:55 +02:00
roboomp 65a7444e94 fix(coding-agent/model-registry): preserved transport override across openrouter rediscovery
mergeDiscoveredModel re-applied baseUrl, headers, and compat from the
provider override when an existing bundled record matched, but dropped
`transport` because the raw /v1/models payload never carries one. With
`transport: pi-native` set for an auth-gateway-routed openrouter
provider in models.yml, the next /model switch after the background
catalog refresh picked the now-transport-less entry and routed through
the default openai-completions client to ${baseUrl}/chat/completions —
a path the auth-gateway never serves, so the gateway returned
"404 No route: POST /chat/completions".

Propagate transport with the same priority as baseUrl: provider
override wins, otherwise preserve the existing (boot-time override-
applied) value, otherwise the discovered value. Cover the regression
both at the merge unit level (xiaomi-tp-discovery-merge) and at the
ModelRegistry refresh level with a mock /models fetch.

Fixes #2555
2026-06-14 09:26:06 +00:00
can1357 69051241f1 fix(ai): added finite output-token fallback when model maxTokens is unknown
- Applied a finite 64,000-token fallback for OpenAI completion requests when model maxTokens is unavailable.
- Refactored stream max-token computation to use a shared helper and preserve a finite cap when caller and model limits are null.
- Added regression coverage for null maxTokens flows and bumped the model-cache schema to invalidate entries using retired unknown-limit sentinels.
2026-06-13 15:52:06 +02:00
can1357 f0c6a54f51 fix: handled unknown model limits as null to avoid artificial token caps
- Replaced unknown model contextWindow/maxTokens sentinels with nullable values across types and catalog data.
- Mapped request token calculations to treat null maxTokens as unlimited output caps.
- Updated remote compaction and context checks to ignore unknown limits by using Infinity/0 fallbacks.
- Adjusted CLI/model registry flows to skip cap enforcement for null limits and render unknown values as '-'.
2026-06-13 15:35:40 +02:00
can1357 e78e936fb6 feat(coding-agent): kept retired variant-id selectors resolving after catalog collapsing
- Resolved retired effort-tier variant ids in `model-resolver.ts` through the hand-table aliases (`resolveVariantAlias`, `resolveBareVariantAlias`) plus the `X-thinking` → `X` grammar (`stripThinkingVariantToken`), with exact matches always winning while a raw id is live and explicit `:effort` suffixes transferring unchanged.
- Re-keyed models.yml `modelOverrides` and rate-limit selector suppressions from raw member ids onto the collapsed model in `model-registry.ts` (`normalizeSuppressedSelector`, lazy `hasLiveModel` checks so live raw ids keep their own overrides).
- Collapsed custom/config provider model lists at registry rebuild via `collapseBuiltModelVariants`, folding config-defined `X`/`X-thinking` twins into one entry.
- Extended `model-registry.test.ts` and `model-resolver.test.ts` with effort-tier variant collapsing and alias-resolution coverage.
2026-06-12 07:37:26 +02:00
can1357 d5b12494e8 test(packages/coding-agent): updated tests for declared effort filters
- Adjusted model-registry runtime-provider test expectations for effort-map filtering.
- Updated model-registry lookup test assertion to require declared effort levels only.
2026-06-12 03:46:03 +02:00
can1357 a25d521cab refactor(catalog): baked thinking metadata into buildModel pipeline
- Replaced minLevel/maxLevel range with explicit efforts array plus baked effortMap/supportsDisplay wire facts.
- Removed runtime enrichment layer and modelOmitsReasoningEffort; providers now read baked fields.
- Fixed dotted Opus 4.7/4.8 ids missing adaptive display via classifier-based predicates (#1373).
- Bumped model cache schema to v4 to invalidate pre-efforts rows.
2026-06-10 07:22:11 +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 1b9d9d0851 refactor(catalog)!: split model catalog from pi-ai
Move bundled models, model cache/manager, thinking metadata, effort helpers,
provider descriptors/discovery, wire constants, and model identity utilities
into the new @oh-my-pi/pi-catalog package.

Update pi-ai to keep provider runtime/auth concerns, move catalog provider
metadata into CATALOG_PROVIDERS, and migrate coding-agent, agent, stats, docs,
and tests to import catalog values from pi-catalog.

Split coding-agent model registry helpers into discovery, roles, and models
config modules while preserving registry orchestration.

BREAKING CHANGE: @oh-my-pi/pi-ai no longer exports catalog subpaths such as
/models, /model-cache, /model-manager, /model-thinking, /effort,
/provider-models*, discovery helpers, and provider wire constants; use the
matching @oh-my-pi/pi-catalog subpaths instead.
2026-06-10 04:06:57 +02:00
can1357 e18b901a8d refactor(packages/coding-agent): reorganized canonical model selection
- Replaced canonical-row resolution with getCanonicalModelSelections in model lists and selector flow.
- Hydrated model selector state from registry on construction and kept cached selections during refresh.
- Preserved highlighted and cached model selection when offline refresh completed or reordered models.
- Added parity checks between getCanonicalModelSelections and resolveCanonicalModel via registry tests.
2026-06-09 20:46:08 +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