Commit Graph

6122 Commits

Author SHA1 Message Date
Peter Steinberger f600e98e5b fix(agents): handle OpenAI web search schema rejects 2026-04-23 06:51:29 +01:00
Peter Steinberger 66f94104c6 test: trim slow CI hotspot coverage 2026-04-23 06:02:26 +01:00
Peter Steinberger 596b88986d chore: apply core lint cleanups 2026-04-23 05:30:49 +01:00
Peter Steinberger cc9dcd3d69 fix(gateway): prefer linux child OOM victims
Raise eligible Linux child processes own oom_score_adj from a child-side /bin/sh exec shim so cgroup memory pressure prefers transient workers over the long-lived gateway. Cover supervisor children, PTY shells, MCP stdio servers, and OpenClaw-launched browser processes through the shared process runtime seam.

Harden the wrapper for distroless images, shell startup env, per-child and process-level opt-outs, dash-compatible exec, and leading-dash command names. Document Linux verification and OOM behavior.

Fixes #70404.

Co-authored-by: Neerav Makwana <261249544+neeravmakwana@users.noreply.github.com>
2026-04-23 05:23:40 +01:00
Peter Steinberger 33aea44fe5 refactor: tighten tool schema types 2026-04-23 05:06:58 +01:00
Peter Steinberger 9937452405 build: enable more zero-baseline oxlint rules 2026-04-23 05:03:58 +01:00
Peter Steinberger b2472d6560 build: migrate schema deps to typebox 2026-04-23 04:59:42 +01:00
Peter Steinberger 35ec4a9991 fix: make session write locks non-reentrant by default 2026-04-23 04:57:30 +01:00
Neerav Makwana d878cf026c fix(pi-embedded-runner): address greptile review on incomplete-turn gate
- Drop redundant !lastToolError check from the messaging-tool clean-stop
  early return; the earlier lastToolError early return already handles
  that case, so the extra condition was dead and misleading.
- Update the CHANGELOG entry to reference only stopReason=stop; the pi-ai
  StopReason type does not include end_turn, so the earlier mention was
  a documentation-only discrepancy.
2026-04-23 04:57:09 +01:00
Neerav Makwana 6cd9136f2d fix(pi-embedded-runner): suppress incomplete-turn warning after clean messaging-tool delivery
The agent runner was surfacing a '⚠️ Agent couldn't generate a response'
warning even when the assistant had already sent user-visible content
through a messaging tool and the turn ended cleanly. Treat that path as
a successful delivery and skip the warning while keeping real failure
modes (tool errors, stopReason=error, interrupted tool use) intact.

Fixes #70396.
2026-04-23 04:57:09 +01:00
Peter Steinberger e61eba11e6 fix: avoid plugin normalization in status model refs 2026-04-23 04:43:25 +01:00
Peter Steinberger 2e40ca2c15 build: enable additional oxlint rules 2026-04-23 04:42:54 +01:00
Ayaan Zaidi 3eb6edc67c fix(cli): key oauth session epochs on identity 2026-04-23 09:06:56 +05:30
Peter Steinberger 2908190ba2 fix(agents): recover streamed timings usage (#41056) (thanks @xaeon2026) 2026-04-23 04:23:27 +01:00
Peter Steinberger d0d018bdad fix(qa): restore agentic parity tool runtime 2026-04-23 04:22:03 +01:00
zqchris 0020a327b9 fix(agents): defuse unicode-whitespace MEDIA lines 2026-04-23 04:22:03 +01:00
zqchris c165af97d7 fix(agents): defuse TTS transcript fence markers 2026-04-23 04:22:03 +01:00
Chris Zhang 7b51b7b26f fix(agents): preserve spoken text in tts tool result
The tts tool previously returned a fixed "Generated audio reply."
string in its content, so session transcripts lost what was actually
spoken. Across every channel, a voice-only reply left no text record
for future turns, forcing users to recover transcripts from the
provider's API. Echo the synthesized text back in the tool result
content (audio still delivered via details.media).

Sanitize the transcript before embedding so crafted utterances cannot
inject reply directives when tool output is rendered in verbose mode:
MEDIA: at line start and [[…]] markers are interrupted with a
zero-width word joiner (U+2060) that defuses parseReplyDirectives
without altering the visible text.
2026-04-23 04:22:03 +01:00
Peter Steinberger 1e8564cb13 fix(auth-profiles): repair stale codex oauth profiles 2026-04-23 04:03:47 +01:00
Peter Steinberger 06308e21f7 build: update dependencies 2026-04-23 04:00:17 +01:00
Peter Steinberger 1c91f3f09f fix: route btw provider streams by workspace (#70413) (thanks @suboss87) 2026-04-23 03:59:11 +01:00
Subash bc3c8eee2c fix(agents): route /btw through the provider's stream fn so Ollama URLs build correctly 2026-04-23 03:59:11 +01:00
Peter Steinberger da8621df0d fix(openai-completions): enable local streaming usage compat (#68711) (thanks @gaineyllc) 2026-04-23 03:57:04 +01:00
Peter Steinberger 728e29a898 test(agents): cover openai-completions tool-call arg repair 2026-04-23 03:54:16 +01:00
Peter Steinberger f78fc61768 fix(agents): pass embedded tool allowlist to pi sessions 2026-04-23 03:49:04 +01:00
Ted Li 2ba43f5d27 fix(agents): keep tool-call repair scoped by transport 2026-04-23 03:49:04 +01:00
Ted Li 49c7319ea5 fix(agents): repair malformed tool-call args on openai-completions 2026-04-23 03:49:04 +01:00
Peter Steinberger 35c9f96878 test: wait for gateway restart sentinel 2026-04-23 03:42:34 +01:00
Ayaan Zaidi fe5f0cddb9 fix(gateway): bind restart continuation to emitted restart 2026-04-23 08:07:53 +05:30
Ayaan Zaidi f5173589a4 fix(gateway): harden restart acknowledgements 2026-04-23 08:07:53 +05:30
Ayaan Zaidi b982d9e669 fix(gateway): default restart acknowledgement continuations 2026-04-23 08:07:53 +05:30
Peter Steinberger b09aed8271 fix: cap long SDK retry waits (#68474) (thanks @jetd1) 2026-04-23 03:32:35 +01:00
Peter Steinberger 1489febee9 test: cover docker MCP cleanup for subagents 2026-04-23 02:46:13 +01:00
Peter Steinberger ccf2e77e8d fix: retire one-shot subagent MCP runtimes 2026-04-23 02:46:13 +01:00
Peter Steinberger b53bce9f47 fix(agents): filter session previews after visibility 2026-04-23 02:33:55 +01:00
dangoZhang 13882581b6 fix(agents): clean up sessions_list forwarding 2026-04-23 02:33:55 +01:00
dangoZhang 1a4c32e366 feat: expose mailbox session discovery in sessions_list 2026-04-23 02:33:55 +01:00
Peter Steinberger de95e414d1 style: format stale source files 2026-04-23 02:20:10 +01:00
Peter Steinberger 6b41ef311f fix: isolate external direct-message runtime policy 2026-04-23 01:39:56 +01:00
Peter Steinberger 38c76b34f4 test(agents): stabilize context lookup warmup 2026-04-23 00:58:13 +01:00
Peter Steinberger 53e822f407 fix: keep cli reply runs streaming 2026-04-23 00:49:43 +01:00
Peter Steinberger c4e5ca8625 fix(agents): expose configured MCP tools in Pi profiles 2026-04-23 00:47:37 +01:00
Vincent Koc 34e45ecfcc feat(codex): add llm lifecycle hooks (#70312)
* feat(codex): add llm lifecycle hooks

* fix(codex): close llm hook lifecycle gaps

* fix(codex): dedupe llm hook context

* fix(codex): preserve abort and error hook state
2026-04-22 16:19:59 -07:00
Vincent Koc a5128777ee feat(codex): add tool hook parity (#70307)
* feat(codex): add tool hook parity

* fix(codex): stabilize tool hook parity

* fix(codex): tighten transcript hook typing

* fix(codex): preserve mirrored transcript idempotency

* fix(codex): normalize tool hook context
2026-04-22 16:18:10 -07: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
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
Peter Steinberger c87c9742ed fix(telegram): isolate direct chat sandbox sessions 2026-04-22 23:46:34 +01:00
Peter Steinberger 2cd3164a0f feat(providers): share GPT-5 prompt overlay 2026-04-22 23:36:06 +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