Commit Graph

33679 Commits

Author SHA1 Message Date
KateWilkins
f342da5fcc feat: add xai media providers
Add xAI image generation and text-to-speech provider support with docs, live tests, and guarded provider HTTP handling.\n\nThanks @KateWilkins.
2026-04-23 00:07:39 +01:00
Vincent Koc
386a0884d7 fix(hooks): avoid stale lancedb startup fallback 2026-04-22 16:06:55 -07:00
Peter Steinberger
ed0ffa472b docs: clarify codex compaction docs (#69612) (thanks @91wan) 2026-04-23 00:05:47 +01:00
91wan
dee8150bab docs(codex): narrow compaction claims 2026-04-23 00:05:47 +01:00
Peter Steinberger
bee491f439 test(telegram): cover debounce topic keys at seam 2026-04-22 23:57:08 +01:00
Peter Steinberger
9b1f1036ac fix(channels): isolate bundled load failures 2026-04-22 23:56:14 +01:00
Vincent Koc
e8b56a9928 feat(codex): add prompt and compaction hooks (#70313)
* feat(codex): add prompt and compaction hooks

* fix(codex): clean prompt and compaction hook tests
2026-04-22 15:56:08 -07:00
Peter Steinberger
ac8495adaa fix(config): write through single-file includes 2026-04-22 23:53:56 +01:00
wirjo
2a15a3bb53 fix(amazon-bedrock): add known model context windows to discovery (#65952)
* fix(amazon-bedrock): add known model context windows to discovery

Bedrock's ListFoundationModels API does not expose token limits. Discovery
was hardcoding contextWindow: 32000 for every model, causing Claude (1M),
Nova (300K), and other models to hit premature 'Context limit exceeded'
errors and unnecessary session resets.

Adds a lookup table of known context windows for Bedrock models:
- Anthropic Claude: 200K-1M
- Amazon Nova: 128K-1M
- Meta Llama: 128K
- Mistral: 32K-128K
- DeepSeek: 128K
- Cohere: 128K
- AI21 Jamba: 256K

Inference profile prefixes (us., eu., ap., global.) are stripped before
lookup, so us.anthropic.claude-opus-4-6-v1 correctly resolves to 1M.

Also raises the default fallback from 32K to 128K for unknown models —
most modern models have at least 128K context.

Single file change, no type system modifications.

Complementary to #65030 (provenance flag for warning on unknown models).

Fixes #64919
Related: #64250

* add KNOWN_MAX_TOKENS map and expand model coverage

- Add KNOWN_MAX_TOKENS lookup table with Bedrock-optimized values that
  balance response quality against quota burndown (5x rate for Claude 3.7+)
- Add missing models to KNOWN_CONTEXT_WINDOWS: Opus 4.7 (1M), Opus 4.1/4.5,
  Sonnet 4, Claude 3/3.5 Haiku, DeepSeek V3/V3.2, Google Gemma 3
- Refactor prefix-stripping into shared resolveKnownValue() helper
- Fix: use !== undefined instead of truthy check for table lookups
- Wire resolveKnownMaxTokens into toModelDefinition and resolveInferenceProfiles

Quota burndown context: Bedrock reserves input_tokens + max_tokens from
TPM at request start. For Claude 3.7+, output burns at 5x. The values
in KNOWN_MAX_TOKENS are intentionally conservative (8-16K for Claude)
to maximize concurrent throughput while still allowing useful responses.
Thinking budget is added separately by the runtime.

* remove KNOWN_MAX_TOKENS — maxTokens should be handled upstream

Remove the KNOWN_MAX_TOKENS map. Hardcoding maxTokens values in
discovery is the wrong layer to solve this — any explicit value
still gets reserved against Bedrock's TPM quota at request start.

The correct fix is upstream in pi's Bedrock provider: omit maxTokens
from inferenceConfig when not explicitly set, letting the model use
its internal default. This avoids quota waste entirely.

See: badlogic/pi-mono#3399 and badlogic/pi-mono#3400

Keep the expanded KNOWN_CONTEXT_WINDOWS (context windows ARE the
right thing to set in discovery — they affect compaction thresholds
and session management, not API-level quota reservation).

* docs: clarify why hardcoded context windows are needed

Bedrock's ListFoundationModels and GetFoundationModel APIs return no
token limit information — there is no Bedrock API to discover context
windows or max output tokens programmatically. Note that this table
should become a fallback if AWS adds token metadata in the future.

* fix: add au and apac to inference profile prefix regex

Add missing geo prefixes discovered by querying inference profiles
across multiple regions:
- au. (Australia/NZ, used in ap-southeast-2/4/6)
- apac. (Asia-Pacific, used for older models in ap-northeast-1)

Both resolveKnownContextWindow and resolveBaseModelId now handle
all known prefixes: us, eu, ap, apac, au, jp, global.

* test: port au. prefix test from #65449 by @alickgithub2, add apac. coverage

Port the Australia/NZ inference profile test from PR #65449
(credit: @alickgithub2) and extend it to also cover the apac.
prefix discovered in ap-northeast-1.

* expand model coverage: Llama 4, MiniMax, NVIDIA, Mistral 3, GLM, Qwen

Cross-referenced KNOWN_CONTEXT_WINDOWS against live
list-foundation-models API. Added missing models:
- Llama 4 Maverick (1M) and Scout (512K)
- MiniMax M2/M2.1/M2.5 (1M)
- NVIDIA Nemotron Super/Nano variants (128K)
- Mistral Large 3 675B (128K)
- GLM 4.7/4.7-flash/5 (128K)
- Qwen3 Coder/32B/VL (128-256K)

Removed deprecated deepseek.v3-v1:0 and claude-opus-4-20250514
(not in active foundation models list).

* raise default context window from 128K to 200K

200K matches the floor for all current Claude models (the most
popular on Bedrock). Every other active model with a lower actual
limit is already in the explicit table. This ensures new Claude
models get a correct default without requiring a table update.

* test: update discovery test expectations for known context window values

* test: fix remaining contextWindow expectation (default 200K)

* fix(amazon-bedrock): keep conservative context fallback

* docs(changelog): note Bedrock context window fix

* fix(amazon-bedrock): normalize known context fallback

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-22 15:53:41 -07:00
wirjo
420c96e7aa fix(amazon-bedrock-mantle): refresh IAM bearer token via resolveConfigApiKey cache lookup (#68903)
* fix(amazon-bedrock-mantle): refresh IAM bearer token via resolveConfigApiKey cache lookup

The Mantle plugin generates a bearer token from IAM credentials at discovery
time and bakes it as a static string into the provider config. After the
token's cache TTL expires (~1hr), requests fail because resolveConfigApiKey
only handled the explicit AWS_BEARER_TOKEN_BEDROCK env var case.

Fix: expose getCachedIamToken() as a sync read from the existing iamTokenCache,
and wire it into resolveConfigApiKey as a fallback when no explicit env var is
set. The catalog.run still generates/refreshes the token on discovery; this
change ensures the cached token is served at auth resolution time.

Fixes #68900

* fix(amazon-bedrock-mantle): refresh runtime IAM bearer auth

* docs(changelog): note Mantle IAM refresh

* fix(agents): apply runtime auth in simple completion

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-22 15:52:24 -07:00
Devin Robison
2321d67263 fix(gateway): require auth for control ui bootstrap config (#70247)
* fix(gateway): require auth for control ui bootstrap config

* fix(ui): send auth on bootstrap fetch

* fix(ui): keep bootstrap auth same-origin

* fix(ui): refresh bootstrap after auth hello

* docs(changelog): note control ui bootstrap auth

* fix(ui): retry bootstrap auth with alternate shared secret on 401
2026-04-22 16:52:08 -06:00
Peter Steinberger
c87c9742ed fix(telegram): isolate direct chat sandbox sessions 2026-04-22 23:46:34 +01:00
Peter Steinberger
46fba1d814 docs(config): clarify symlinked config support 2026-04-22 23:45:03 +01:00
Devin Robison
95119017c8 fix(openshell): pin sandbox file reads (#69798)
* fix(openshell): pin sandbox file reads against parent symlink swaps

* docs(changelog): note openshell sandbox read pinning (#69798)

* fix(openshell): containment-check against literal root and self-contain file-identity helper

* test(openshell): spy on fsPromises.open for swap races, skip dev=0 test on win32

* fix(openshell): single-syscall fallback identity check + tighten sameFileIdentity types

* fix(openshell): re-fstat pinned handle after identity check for defense-in-depth

* fix(openshell): lstat leaf on platforms without O_NOFOLLOW to close windows symlink gap

* fix(openshell): expose test seam for O_NOFOLLOW availability instead of patching native constants
2026-04-22 16:44:25 -06:00
Val Alexander
12bbb371d0 feat(control-ui): personalize local user identity and tighten layouts
## Summary
- add browser-local operator identity in Control UI and route user name/avatar rendering through the shared chat/avatar path used by assistant and agent surfaces
- tighten Quick Settings, fallback chip, and mobile chat layout behavior so the personalized UI uses space better and avoids clipped controls
- guard oversized local avatar uploads before FileReader allocation, restore the fallback-chip keyboard focus ring, and add the changelog note for the user-visible Control UI work

## Testing
- pnpm test ui/src/ui/views/config-quick.test.ts ui/src/styles/components.test.ts
- pnpm check:changed
2026-04-22 17:38:58 -05:00
Peter Steinberger
5daa104e63 docs: note codex approval hardening (#70356) (thanks @Lucenx9) 2026-04-22 23:38:44 +01:00
Lucenx9
ec5015924c fix(codex): fail closed for unknown approvals 2026-04-22 23:38:44 +01:00
Peter Steinberger
4285958bcd test(codex): cover websocket token rotation (#70328) (thanks @Lucenx9) 2026-04-22 23:37:58 +01:00
Lucenx9
15f285c0cb fix(codex): scope stale shared-client cleanup 2026-04-22 23:37:58 +01:00
Lucenx9
0bc5ccc706 fix(codex): rotate shared app-server clients on auth changes 2026-04-22 23:37:58 +01:00
Peter Steinberger
f4c4e940a6 test(qa): stabilize lab catalog abort fixture 2026-04-22 23:36:34 +01:00
Peter Steinberger
2cd3164a0f feat(providers): share GPT-5 prompt overlay 2026-04-22 23:36:06 +01:00
Peter Steinberger
7b2c9a6fa3 fix(config): recover critical config clobbers 2026-04-22 23:35:48 +01:00
Peter Steinberger
1d7be63228 ci: rebalance extension test shards 2026-04-22 23:29:34 +01:00
Peter Steinberger
22814c1add docs(config): document safe model config merges 2026-04-22 23:23:54 +01:00
Peter Steinberger
f7e668d0ec chore: record extension runtime deps 2026-04-22 23:19:20 +01:00
Peter Steinberger
c2ac1e3ef4 feat: expose OpenClaw tools to ACPX 2026-04-22 23:19:20 +01:00
Peter Steinberger
87f8e82347 fix: isolate Codex ACP auth 2026-04-22 23:18:56 +01:00
Peter Steinberger
819ff0463a fix(config): protect model config merges 2026-04-22 23:18:05 +01:00
Peter Steinberger
f88da75ed9 refactor(channels): centralize runtime binding routes 2026-04-22 23:16:57 +01:00
Peter Steinberger
85d2a9ec1f test(cron): add docker mcp cleanup e2e 2026-04-22 23:12:18 +01:00
Peter Steinberger
816d7a7232 chore(extensions): update runtime dependency manifests 2026-04-22 23:11:43 +01:00
Devin Robison
b76edc09e6 fix(gateway): reauthorize session history SSE updates (#70237)
* fix(gateway): reauthorize session history SSE updates

* docs(changelog): note session history sse reauth

* fix(gateway): use live proxy config for sse reauth

* fix(gateway): skip unrelated session sse reauth

* fix(gateway): filter sse transcript updates early, log work failures, forward-declare cleanup bindings
2026-04-22 16:11:32 -06:00
Peter Steinberger
698f154c28 fix(qa): recheck Matrix sync events after poll 2026-04-22 23:11:27 +01:00
Peter Steinberger
a32a6c2f89 fix: stop generating qa npm sidecars 2026-04-22 23:11:01 +01:00
Peter Steinberger
f66098f8f6 test(github-copilot): add live Responses ID rewrite probe 2026-04-22 23:09:31 +01:00
Peter Steinberger
03c1fff8f6 test(qa): add OpenAI native web search live scenario 2026-04-22 23:06:55 +01:00
Peter Steinberger
1a90893e90 test: keep extension directory filters covered 2026-04-22 23:06:26 +01:00
Val Alexander
eb689f3535 fix(ui): shorten Control UI clear action label (#70355) 2026-04-22 16:52:53 -05:00
Peter Steinberger
e56a6f87ec fix: exclude qa extensions from npm package 2026-04-22 22:48:28 +01:00
Peter Steinberger
ebe32e5cee feat(openai): enable native web search 2026-04-22 22:47:26 +01:00
Peter Steinberger
276d222283 build(deps): bump fast-xml-parser override 2026-04-22 22:45:57 +01:00
wirjo
c7e5289fd2 fix: propagate AWS SDK auth sentinel for IMDS/instance role Bedrock auth (#68964)
* fix: propagate AWS SDK auth sentinel for IMDS/instance role Bedrock auth

When Bedrock auth resolves via AWS SDK default credential chain (IMDS,
ECS task role) with no explicit API key, the auth controller returned
early without calling setRuntimeApiKey(). This left pi's authStorage
unaware that the provider is authenticated, causing 'No API key found
for amazon-bedrock' errors.

Now, when mode is 'aws-sdk' and no explicit API key is available:
1. Try prepareProviderRuntimeAuth to resolve runtime credentials
2. If that returns a real apiKey, use it with auth refresh scheduling
3. Otherwise inject a '__aws_sdk_auth__' sentinel so pi's
   hasConfiguredAuth() passes and the AWS SDK handles request signing

This is a focused fix in auth-controller.ts only, avoiding the risky
model-auth-runtime-shared.ts changes that could re-introduce the
fake-apiKey injection pattern on ECS (see prior regressions #49891,
#50699, #54274).

Fixes #62995

* fix(pi-auth): clean up aws-sdk sentinel fallback

* docs(changelog): note aws-sdk Bedrock auth fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-22 14:45:26 -07:00
Peter Steinberger
207d7303b7 test: avoid argv warmup race 2026-04-22 22:42:45 +01:00
Peter Steinberger
2e13f224d6 fix(openai-responses): normalize Copilot response item IDs (#69362) (thanks @Menci) 2026-04-22 22:40:43 +01:00
Vincent Koc
4f9169c6dd fix(hooks): avoid stale skill workshop startup fallback 2026-04-22 14:39:58 -07:00
Peter Steinberger
7f637eafe2 test: run single-channel extension batches 2026-04-22 22:39:17 +01:00
Peter Steinberger
d1e06407bf chore: add extension runtime dependency manifests 2026-04-22 22:36:40 +01:00
Peter Steinberger
6ab3751287 fix: preserve Azure OpenAI completions api version 2026-04-22 22:36:40 +01:00
Peter Steinberger
cb16d22780 fix(cron): retire bundled mcp runtimes 2026-04-22 22:30:47 +01:00