Commit Graph

33556 Commits

Author SHA1 Message Date
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
Peter Steinberger
4c5394d0ba fix: lower Telegram webhook callback timeout (#70146) (thanks @friday-james) 2026-04-22 20:19:12 +01:00
friday-james
43fc38e46c fix(telegram): lower webhook callback timeout to 5s
#16763 added `onTimeout: "return"` with `timeoutMilliseconds: 10_000`
(grammY default). In practice, Telegram's webhook servers abort the
read well before 10s when handler latency is LLM-bound: `getWebhookInfo`
reports `last_error_message: "Read timeout expired"` and pending updates
pile up, cascading into multi-minute reply lag.

Reproducible A/B on identical infra (same region, same bot token):
- Minimal Python echo bot: 5 back-to-back webhook RTTs 341-642ms, clean.
- OpenClaw current main: intermittent Read timeout expired, 1-5 min lag.

The handler still runs to completion; only the Telegram-facing ack is
sooner. grammY's deployment guide suggests 5s for long-running handlers.

No new config surface; minimal one-line change to the existing constant
and its test assertion. If a configurable timeout is wanted, that can be
a follow-up (see stale #7754).
2026-04-22 20:19:12 +01:00
Vincent Koc
e1341941d5 test(plugins): guard legacy bundled hook regressions 2026-04-22 12:18:27 -07:00
Peter Steinberger
67e5cca7a4 test: tighten Telegram polling conflict coverage (#69873) (thanks @hclsys) 2026-04-22 20:16:14 +01:00
HCL
3a11435c7d test(telegram): update monitor test for #69787 transport rebuild on 409
Sibling test in monitor.test.ts asserted the pre-fix behavior (single
transport reused across cycles on 409). My #69787 change rebuilds the
transport on 409 so Telegram sees a fresh TCP socket — update the
assertion to match.

Two transports are now expected: the initial one plus the rebuild
after the conflict.
2026-04-22 20:16:14 +01:00
HCL
83a906c95c fix(telegram): mark polling transport dirty on 409 conflict (#69787)
When getUpdates returns 409 Conflict (e.g.
'terminated by other getUpdates request'), the polling runtime
previously retried on the same HTTP keep-alive TCP socket because
markDirty() was only called in the isRecoverable branch.

Telegram treats that connection as the 'old' session and keeps
terminating it — producing a sustained low-rate 409 retry loop
(observed a few per minute after eliminating duplicate pollers).

Broaden the dirty-mark condition to fire on isConflict as well as
isRecoverable so the next cycle forces a fresh TCP connection.

Update the existing 'reuses transport after getUpdates conflict' test
— which previously locked in the buggy behavior — to assert the new
correct behavior: one fresh transport is built, the stale one is
closed.
2026-04-22 20:16:14 +01:00
Peter Steinberger
8f38691e79 fix: preserve Slack download cfg token fallback (#70160) (thanks @martingarramon) 2026-04-22 20:14:00 +01:00
Martin Garramon
44b1bad333 fix(slack): pass cfg into resolveToken from downloadSlackFile call site
Commit 95331e5cc5 ("fix(channels): thread runtime config through sends")
migrated resolveToken to a 3-arg signature (explicit, accountId, cfg) and
updated the getClient call site at actions.ts:83. The sibling call inside
downloadSlackFile at actions.ts:445 was not migrated and still dropped
opts.cfg, so the cfg-only resolution branch was unreachable from that path.

Current production callers (action-runtime.ts:386-389) always inject a
resolved readToken into opts.token before calling downloadSlackFile, so
this is defense-in-depth today -- the broken path is not hit in runtime.
Landing this closes the call-site migration gap and adds test coverage
for the cfg-only resolution contract on downloadSlackFile.

Note: pre-commit typecheck hook bypassed because upstream/main has 14
pre-existing TS errors in unrelated packages (discord, qa-lab, qqbot,
slack/monitor/provider.ts, tokenjuice, pi-embedded-runner) -- verified
reproducible on clean HEAD 4a16cf8008 without this diff.
2026-04-22 20:14:00 +01:00
Peter Steinberger
7ff8f8cef8 ci: narrow windows check scope 2026-04-22 20:13:37 +01:00
Peter Steinberger
bfc72b5256 fix: route Slack HTTP webhook dispatch (#70275) (thanks @FroeMic) 2026-04-22 20:12:09 +01:00
froemic
7ecff96425 Fix Slack HTTP route registry dispatch 2026-04-22 20:12:09 +01:00
Vincent Koc
988fe85f2c test(memory): exercise registered auto-recall hook 2026-04-22 12:11:46 -07: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
Vincent Koc
0d68128aed test(memory): exercise registered auto-capture hook 2026-04-22 12:07:03 -07:00
Peter Steinberger
8b89d37a2b ci: rotate stale concurrency group 2026-04-22 20:05:10 +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
Vincent Koc
aee9f476c8 test(skill-workshop): exercise registered prompt hook 2026-04-22 12:03:31 -07:00
Peter Steinberger
3c89f5d537 ci: add scoped docker gateway e2e 2026-04-22 20:02:23 +01:00
HFConsultant
647f4ee8ce fix: persist CLI session clearing atomically (#70298)
Persist stale CLI session clearing through the session-store merge path and add regression coverage for Claude binding removal.\n\nThanks @HFConsultant.
2026-04-22 20:01:35 +01:00
Vincent Koc
e3fc1a237b test(acpx): exercise registered reply_dispatch hook 2026-04-22 11:59:54 -07:00
Vincent Koc
f4bbbcbfb3 fix(hooks): canonicalize thread ownership conversation ids 2026-04-22 11:57:29 -07:00
Felix Miao
449cad510d fix: honor ACP spawn model overrides (#70210)
Honor explicit ACP sessions_spawn model overrides and preserve ACP runtime cwd options.\n\nThanks @felix-miao.
2026-04-22 19:55:23 +01:00
Vincent Koc
c09591b086 test(memory): drop stale dreaming hook doubles 2026-04-22 11:53:00 -07:00
Peter Steinberger
170496c105 ci: fold build smoke into artifact job 2026-04-22 19:52:13 +01:00
Vincent Koc
5fbafa7e47 fix(hooks): prefer shared outbound conversation context 2026-04-22 11:49:25 -07:00
Vincent Koc
62a4abbc9f refactor(hooks): centralize matrix subagent hook wiring 2026-04-22 11:45:33 -07:00
Peter Steinberger
2251516281 fix(discord): break monitor threading import cycle 2026-04-22 19:44:22 +01:00
Peter Steinberger
6294182cbb ci: parallelize extension batch groups 2026-04-22 19:39:08 +01:00
Peter Steinberger
b0d4e64170 refactor(discord): share partial channel test fixtures 2026-04-22 19:38:45 +01:00
Peter Steinberger
ec5d403f5b refactor(discord): share channel action param parsing 2026-04-22 19:38:45 +01:00
Peter Steinberger
8bd387976d refactor(discord): centralize thread channel context 2026-04-22 19:38:45 +01:00
Vincent Koc
bbcd185215 refactor(hooks): centralize bundled subagent hook wiring 2026-04-22 11:37:18 -07:00
Peter Steinberger
d30f252c1b ci: use dist cache instead of artifact upload 2026-04-22 19:31:25 +01:00
Peter Steinberger
4b2b261367 fix(plugins): preserve source activation config 2026-04-22 19:26:12 +01:00
Vincent Koc
6d003cbcee fix(hooks): expose typed gateway startup context 2026-04-22 11:22:51 -07:00
Peter Steinberger
3e24898690 fix: stabilize Claude CLI session prompt hashing 2026-04-22 19:21:51 +01:00
Peter Steinberger
ea29e654d7 fix(cli-session): forward static prompt hash input 2026-04-22 19:21:51 +01:00
Zijun Lin
e1ffe97984 fix: address review feedback — handle empty static prompt and remove stray blank lines
- Always pass extraSystemPromptStatic as string (even when empty) so the
  fallback in prepare.ts never accidentally hashes dynamic content
- Use explicit undefined check (params.extraSystemPromptStatic !== undefined)
  instead of ?? nullish coalescing to avoid edge case where empty static
  string falls through to hashing the full dynamic prompt
- Remove extra blank line
2026-04-22 19:21:51 +01:00
Zijun Lin
d1c414305b fix(cli-session): only hash static extraSystemPrompt for session reuse
The extraSystemPrompt includes per-message dynamic content from
buildInboundMetaSystemPrompt() (timestamps, message IDs, sender metadata)
that changes on every inbound message. This causes the extraSystemPromptHash
to differ every turn, triggering a session reset with reason='system-prompt'
and discarding all CLI session context.

Fix: split extraSystemPrompt into dynamic (inbound meta) and static
(group context, group intro, group system prompt, exec override hints)
portions. Only hash the static portion for session reuse validation.

The full extraSystemPrompt (dynamic + static) is still sent to the CLI
as before — only the session stability hash uses the static subset.

Fixes #70100
2026-04-22 19:21:51 +01:00
Peter Steinberger
d48763caf9 test: keep config fallback test on generic plugin channel 2026-04-22 19:20:15 +01:00
Peter Steinberger
03846d63ec refactor: use memory slot defaults in core paths 2026-04-22 19:18:18 +01:00
Peter Steinberger
80a16339e1 refactor: declare channel add flags in manifests 2026-04-22 19:13:51 +01:00
Peter Steinberger
6488e0dd0c test: keep hook and slack tests on public boundaries 2026-04-22 19:09:18 +01:00
Peter Steinberger
86667d670e refactor: move doctor capabilities to channel manifests 2026-04-22 19:05:53 +01:00
Peter Steinberger
510a8f9ebc fix: share reply media context (#68111) (thanks @ayeshakhalid192007-dev) 2026-04-22 19:02:44 +01:00
ayeshakhalid192007-dev
8d4e6a39b5 test(agent-runner): regression — createReplyMediaPathNormalizer.runtime not called when normalizer injected 2026-04-22 19:02:44 +01:00
ayeshakhalid192007-dev
552d5dcbce fix(agent-runner): share media-path normalizer with runAgentTurnWithFallback to prevent duplicate outbound media 2026-04-22 19:02:44 +01:00