Commit Graph

20875 Commits

Author SHA1 Message Date
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
Vincent Koc
4f9169c6dd fix(hooks): avoid stale skill workshop startup fallback 2026-04-22 14:39:58 -07: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
Peter Steinberger
1dc5aad316 test: align matrix acp room binding expectations 2026-04-22 22:30:22 +01:00
Peter Steinberger
8a3e130db8 fix(slack): honor focused thread bindings 2026-04-22 22:29:48 +01:00
Peter Steinberger
5d50b0c48f fix(config): recover prefixed config JSON 2026-04-22 22:29:01 +01:00
Peter Steinberger
77dbc1cda6 ci: rebalance test workers 2026-04-22 22:26:02 +01:00
Vincent Koc
65ae1e54de fix(hooks): avoid stale thread ownership startup fallback 2026-04-22 14:19:13 -07:00
Peter Steinberger
50c95d1d21 refactor(channels): centralize conversation resolution 2026-04-22 22:16:08 +01:00
Vincent Koc
f1372681a8 fix(diffs): refresh live viewer access policy 2026-04-22 14:14:30 -07:00
Peter Steinberger
0588dfe15d fix(config): parse quoted bracket paths 2026-04-22 22:11:45 +01:00
Peter Steinberger
a971884104 test(mcp): strengthen stdio lifecycle coverage 2026-04-22 22:11:30 +01:00
Peter Steinberger
a1319aaadd fix(update): skip package no-op installs 2026-04-22 22:05:29 +01:00
Peter Steinberger
64fb6f71b4 fix(gateway): recover invalid config before startup 2026-04-22 22:05:29 +01:00
Peter Steinberger
f70a46b703 fix(config): preserve authored config writes 2026-04-22 22:05:29 +01:00
Peter Steinberger
5f7b44045d fix(mcp): tear down stdio process trees 2026-04-22 22:04:22 +01:00
Peter Steinberger
2c45879120 fix(config): render warning newlines 2026-04-22 22:04:09 +01:00
Peter Steinberger
b6fbf46eca fix(cron): repair malformed cron job ids via doctor 2026-04-22 22:03:58 +01:00
Peter Steinberger
2e38e09b04 test: harden parallels smoke harness 2026-04-22 22:01:04 +01:00
Vincent Koc
0f0d399c71 fix(hooks): stop memory-core runtime config fallback 2026-04-22 13:57:10 -07:00
Vincent Koc
fc07b23437 fix(agents): restore pi session tool activation 2026-04-22 13:54:04 -07:00
Vincent Koc
42400813a7 test(plugins): pin live config hook guards 2026-04-22 13:50:51 -07:00
Peter Steinberger
aad1be102d fix(types): narrow live thread ownership config 2026-04-22 21:48:59 +01:00
Vincent Koc
e250ea3668 fix(agents): centralize native websocket endpoint checks 2026-04-22 13:44:51 -07:00
Vincent Koc
db5895fd2a refactor(hooks): centralize live plugin config lookup 2026-04-22 13:38:38 -07:00
Peter Steinberger
6639b21ade test(media): harden media store URI validation 2026-04-22 21:05:41 +01:00
Devin Matthews
5528793adf fix: honor explicit strict-agentic retry contract
Honor explicit strict-agentic execution contracts for incomplete-turn retry guards across providers, including local/compatible models that opt in without relying on OpenAI model inference.

Validation:
- pnpm test src/agents/pi-embedded-runner/run.incomplete-turn.test.ts
- pnpm check:changed
- GitHub CI + parity gate green

Thanks @ziomancer.
2026-04-22 21:03:03 +01:00
Peter Steinberger
c0cafb6bbe perf(plugins): cache normalized jiti aliases 2026-04-22 21:02:29 +01:00
Val Alexander
9ea5484fa1 fix: normalize opus 4.7 context window
Normalize Anthropic-owned Opus 4.7 context reporting to 1M while keeping inferred and bare discovery paths conservative.

- normalize Anthropic and claude-cli Opus 4.7 runtime/status context metadata to 1M
- keep inferred-provider and bare discovery ids on discovered conservative limits
- add regression coverage for provider, lookup, status, and discovery-cache paths
- keep the Telegram abort-signal wrapper typing narrow so changed-scope validation stays green
2026-04-22 14:58:16 -05:00
Josh Lehman
ccc99d85bf fix: restore Pi embedded tool allowlist
Restore the Pi embedded session tool allowlist for OpenAI/OpenAI Codex GPT-5 runs and compaction sessions after Pi 0.68.1 began treating session tools as a global allowlist.

Local validation: pnpm check:changed.
GitHub validation: check/check-additional/node shards green; parity gate red on unrelated config.patch stale/rate-limit QA harness scenario after plugins.allow restart.
2026-04-22 20:51:42 +01:00
Tak Hoffman
78d491d909 feat(commands): gate /models add with modelsWrite (#70321) 2026-04-22 14:49:07 -05:00
Peter Steinberger
976398715f fix(image): resolve custom provider model IDs 2026-04-22 20:32:05 +01:00
Peter Steinberger
81f247b1ae fix(agents): dedupe emitted TTS media 2026-04-22 20:32:05 +01:00
Peter Steinberger
e5b67b7ebd fix(media): load inbound media store URIs 2026-04-22 20:32:05 +01:00
Peter Steinberger
0e761cdba8 fix(gateway): redact audio payloads from chat history 2026-04-22 20:32:05 +01:00
Peter Steinberger
64a98dea8d fix(discord): restore DM reactions and guild activation 2026-04-22 20:29:50 +01:00
Peter Steinberger
f7a52573b0 fix: clear phantom Claude CLI resumes (#70317)
Verify Claude CLI session transcripts before reuse and clear phantom bindings with transcript-missing instead of passing stale --resume ids.\n\nFixes #70177.
2026-04-22 20:29:17 +01:00
Peter Steinberger
9c733956c0 fix(plugins): repair bundled deps on activation 2026-04-22 20:27:42 +01:00
Vincent Koc
9a14307306 test(plugins): pin bundled hook names 2026-04-22 12:22:44 -07:00
Peter Steinberger
d8935ca838 perf: keep gateway live probes off helper imports 2026-04-22 20:22:14 +01:00
Vincent Koc
d0bf9cc19e test(plugins): pin bundled hook registration surfaces 2026-04-22 12:20:21 -07:00
anirudhmarc
24266af1ce fix(amazon-bedrock): inject cache points for application inference profile ARNs (#69953)
* fix(amazon-bedrock): inject cache points for application inference profile ARNs

pi-ai's internal supportsPromptCaching checks model.id for specific Claude
model name patterns (e.g. "-4-", "claude-3-7-sonnet"), which fails for
application inference profile ARNs that don't contain the model name.
This causes prompt caching to silently break for Bedrock users with
application inference profiles.

Work around this by detecting when pi-ai would miss cache point injection
(via piAiWouldInjectCachePoints mirror) and patching the Converse API
payload via onPayload to add cachePoint blocks to the system prompt and
last user message — matching the same format pi-ai uses natively.

The fix is safe:
- Checks for existing cache points to avoid double-injection
- Respects cacheRetention: "none"
- Defaults to "short" retention (matching pi-ai default)
- Becomes a no-op once upstream pi-mono#2925 is fixed

Fixes #19279
Upstream: https://github.com/badlogic/pi-mono/issues/2925

* fix(amazon-bedrock): tighten app-profile cache injection

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-22 12:19:29 -07:00
Vincent Koc
e1341941d5 test(plugins): guard legacy bundled hook regressions 2026-04-22 12:18:27 -07:00
Peter Steinberger
7ff8f8cef8 ci: narrow windows check scope 2026-04-22 20:13:37 +01:00
zqchris
b24ae8b18b fix(auto-reply): preserve streaming reply directives (#70243)
Preserve streamed MEDIA/reply/audio directives across chunk boundaries and phase-aware final_answer delivery.\n\nThanks @zqchris.
2026-04-22 20:11:00 +01:00
Peter Steinberger
b1b1979841 ci: skip windows for test-only changes 2026-04-22 20:10:27 +01:00
Neerav Makwana
5462d4d5c5 fix: drop silent parent replies while subagents are pending (#69942)
Drop bare parent NO_REPLY payloads while spawned subagents are pending, preserving quiet parent turns until child completion delivers the real reply.\n\nThanks @neeravmakwana.
2026-04-22 20:04:38 +01:00
Peter Steinberger
3c89f5d537 ci: add scoped docker gateway e2e 2026-04-22 20:02:23 +01:00