Commit Graph

577 Commits

Author SHA1 Message Date
Sparkyrider 55dc6a8bb2 cron: queue isolated delivery awareness 2026-03-25 15:21:14 +05:30
ToToKr 4140100807
fix: clarify cron best-effort partial delivery status (#42535) (thanks @MoerAI)
* fix(cron): track and log bestEffort delivery failures, mark not delivered on partial failure

* fix(cron): cache successful results on partial failure to preserve replay idempotency

When a best-effort send partially fails, we now still cache the successful delivery results via rememberCompletedDirectCronDelivery. This prevents duplicate sends on same-process replay while still correctly marking the job as not fully delivered.

* fix(cron): preserve partial-failure state on replay (#27069)

* fix(cron): restore test infrastructure and fix formatting

* fix: clarify cron best-effort partial delivery status (#42535) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 12:49:32 +05:30
w-sss 247f82119c
fix: improve Telegram 403 membership delivery errors (#53635) (thanks @w-sss)
* fix(telegram): improve error messages for 403 bot not member errors

- Detect 403 'bot is not a member' errors specifically
- Provide actionable guidance for users to fix the issue
- Fixes #48273 where outbound sendMessage fails with 403

Root cause:
When a Telegram bot tries to send a message to a channel/group it's not
a member of, the API returns 403 'bot is not a member of the channel chat'.
The error message was not clear about how to fix this.

Fix:
1. Detect 403 errors in wrapTelegramChatNotFoundError
2. Provide clear error message explaining the issue
3. Suggest adding the bot to the channel/group

* fix(telegram): fix regex precedence for 403 error detection

- Group alternatives correctly: /403.*(bot.*not.*member|bot was blocked)/i
- Require 403 for both alternatives (previously bot.*blocked matched any error)
- Update error message to cover both scenarios
- Fixes Greptile review feedback

* fix(telegram): correct regex alternation precedence for 403 errors

- Fix: /403.*(bot.*not.*member|bot was blocked)/ → /403.*(bot.*not.*member|bot.*blocked)/
- Ensures 403 requirement applies to both alternatives
- Fixes Greptile review comment on PR #48650

* fix(telegram): add 'bot was kicked' to 403 error regex and message

* fix(telegram): preserve membership delivery errors

* fix: improve Telegram 403 membership delivery errors (#53635) (thanks @w-sss)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 10:59:29 +05:30
Peter Steinberger 46d3617d25
refactor: split gateway plugin bootstrap and registry surfaces 2026-03-24 22:16:26 -07:00
Peter Steinberger 217cb0ac58 test: speed up plugin-sdk and cron suites 2026-03-24 17:49:25 +00:00
Tak Hoffman 50d996a6ec
tests: cron coverage and NO_REPLY delivery fixes (#53366)
* tools: extend seam audit inventory

* tools: audit cron seam coverage gaps

* test: add cron seam coverage tests

* fix: avoid marking NO_REPLY cron deliveries as delivered

* fix: clean up delete-after-run NO_REPLY cron sessions
2026-03-23 22:52:13 -05:00
Peter Steinberger 38137b0cf8
refactor: split tracked ClawHub update flows 2026-03-23 20:01:51 -07:00
Peter Steinberger e530865274 fix: preserve legacy clawhub skill updates (#53206) (thanks @drobison00) 2026-03-23 19:34:05 -07:00
Peter Steinberger 2a06097184
test: update codex test fixtures to gpt-5.4 2026-03-23 02:14:00 -07:00
Peter Steinberger fb602c9b02 test: harden ci isolated mocks 2026-03-23 08:53:35 +00:00
Peter Steinberger 7cee097df9
test: harden no-isolate mocked module resets 2026-03-23 01:33:47 -07:00
Peter Steinberger 72e58ca260
test(models): refresh example model fixtures 2026-03-22 23:00:18 -07:00
Peter Steinberger ea579ef858
fix(gateway): preserve async hook ingress provenance 2026-03-22 22:21:49 -07:00
Vincent Koc 2131981230 refactor(plugins): move remaining channel and provider ownership out of src 2026-03-22 19:13:25 -07:00
Peter Steinberger 1e1372027e perf: avoid cron startup store reload churn 2026-03-22 21:52:42 +00:00
Vincent Koc 11ca41f457 fix(test): repair cron and loader regressions 2026-03-22 14:39:17 -07:00
Peter Steinberger 2773f33084
test: stabilize vitest no-isolate suites 2026-03-22 14:28:43 -07:00
Peter Steinberger 9267e694f7 perf: reduce cron persistence churn 2026-03-22 21:28:16 +00:00
Peter Steinberger 2c05e07f68
test: reset leaked cron fake timers 2026-03-22 14:22:21 -07:00
Peter Steinberger 7a3346871e test: fix no-isolate integration regressions 2026-03-22 20:41:03 +00:00
Peter Steinberger 8eb881ef18
test: harden no-isolate mock and timer cleanup 2026-03-22 13:32:59 -07:00
Peter Steinberger 1ceaad18a6
test: harden vitest no-isolate coverage 2026-03-22 10:48:21 -07:00
Peter Steinberger b70b7b0d94 test: trim more local test startup overhead 2026-03-22 09:35:36 +00:00
Vincent Koc c96a12aeb9
Agents: add per-agent defaults and safe model fallback (#51974)
* Agents: add per-agent defaults and safe model fallback

* Docs: add per-agent thinking/reasoning/fast defaults to config reference and thinking docs

* Format get-reply directives

* Auto-reply: guard agent reasoning defaults

* Docs: update config baseline
2026-03-21 22:27:24 -07:00
Peter Steinberger 8727338372 perf: extract lightweight runtime seams 2026-03-22 05:03:10 +00:00
Peter Steinberger 4229ffe2b9 perf: reduce runtime and test startup overhead 2026-03-21 20:18:16 +00:00
Peter Steinberger 6526074c85 test: trim singleton cold-start reloads 2026-03-20 23:14:28 +00:00
Peter Steinberger 62ddc9d9e0 refactor: consolidate plugin sdk surface 2026-03-20 19:24:10 +00:00
Vincent Koc a39c440d39 fix(config): share json compatibility parsing 2026-03-20 10:17:53 -07:00
Vincent Koc 93fbe26adb
fix(config): tighten json and json5 parsing paths (#51153) 2026-03-20 10:10:57 -07:00
Shakker c95d1c101b
fix(cron): avoid async context token warmup in isolated runs 2026-03-20 01:11:58 +00:00
Tak Hoffman 126839380c
Tests: fix current check failures 2026-03-18 22:58:40 -05:00
clay-datacurve 7b61ca1b06
Session management improvements and dashboard API (#50101)
* fix: make cleanup "keep" persist subagent sessions indefinitely

* feat: expose subagent session metadata in sessions list

* fix: include status and timing in sessions_list tool

* fix: hide injected timestamp prefixes in chat ui

* feat: push session list updates over websocket

* feat: expose child subagent sessions in subagents list

* feat: add admin http endpoint to kill sessions

* Emit session.message websocket events for transcript updates

* Estimate session costs in sessions list

* Add direct session history HTTP and SSE endpoints

* Harden dashboard session events and history APIs

* Add session lifecycle gateway methods

* Add dashboard session API improvements

* Add dashboard session model and parent linkage support

* fix: tighten dashboard session API metadata

* Fix dashboard session cost metadata

* Persist accumulated session cost

* fix: stop followup queue drain cfg crash

* Fix dashboard session create and model metadata

* fix: stop guessing session model costs

* Gateway: cache OpenRouter pricing for configured models

* Gateway: add timeout session status

* Fix subagent spawn test config loading

* Gateway: preserve operator scopes without device identity

* Emit user message transcript events and deduplicate plugin warnings

* feat: emit sessions.changed lifecycle event on subagent spawn

Adds a session-lifecycle-events module (similar to transcript-events)
that emits create events when subagents are spawned. The gateway
server.impl.ts listens for these events and broadcasts sessions.changed
with reason=create to SSE subscribers, so dashboards can pick up new
subagent sessions without polling.

* Gateway: allow persistent dashboard orchestrator sessions

* fix: preserve operator scopes for token-authenticated backend clients

Backend clients (like agent-dashboard) that authenticate with a valid gateway
token but don't present a device identity were getting their scopes stripped.
The scope-clearing logic ran before checking the device identity decision,
so even when evaluateMissingDeviceIdentity returned 'allow' (because
roleCanSkipDeviceIdentity passed for token-authed operators), scopes were
already cleared.

Fix: also check decision.kind before clearing scopes, so token-authenticated
operators keep their requested scopes.

* Gateway: allow operator-token session kills

* Fix stale active subagent status after follow-up runs

* Fix dashboard image attachments in sessions send

* Fix completed session follow-up status updates

* feat: stream session tool events to operator UIs

* Add sessions.steer gateway coverage

* Persist subagent timing in session store

* Fix subagent session transcript event keys

* Fix active subagent session status in gateway

* bump session label max to 512

* Fix gateway send session reactivation

* fix: publish terminal session lifecycle state

* feat: change default session reset to effectively never

- Change DEFAULT_RESET_MODE from "daily" to "idle"
- Change DEFAULT_IDLE_MINUTES from 60 to 0 (0 = disabled/never)
- Allow idleMinutes=0 through normalization (don't clamp to 1)
- Treat idleMinutes=0 as "no idle expiry" in evaluateSessionFreshness
- Default behavior: mode "idle" + idleMinutes 0 = sessions never auto-reset
- Update test assertion for new default mode

* fix: prep session management followups (#50101) (thanks @clay-datacurve)

---------

Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
2026-03-19 12:12:30 +09:00
Tyler Yust a290f5e50f
fix: persist outbound sends and skip stale cron deliveries (#50092)
* fix(bluebubbles): auto-create chats for new numbers, persist outbound messages to session transcripts

Two fixes for BlueBubbles message tool behavior:

1. **Attachment sends to new phone numbers**: sendBlueBubblesAttachment now
   auto-creates a new DM chat (via /api/v1/chat/new) when no existing chat
   is found for a handle target, matching the behavior already present in
   sendMessageBlueBubbles for text sends. The existing createNewChatWithMessage
   is refactored into a reusable createChatForHandle that returns the chatGuid.

2. **Outbound message session persistence**: Ensures outbound messages sent
   via the message tool are reliably tracked in session transcripts:
   - ensureOutboundSessionEntry now falls back to directly creating a session
     store entry when recordSessionMetaFromInbound returns null, guaranteeing
     a sessionId exists for the subsequent mirror append.
   - appendAssistantMessageToSessionTranscript now normalizes the session key
     (lowercased) when looking up the store, preventing case mismatches
     between the store keys and the mirror sessionKey.

Tests added for all changes.

* test(slack): verify outbound session tracking and new target sends for Slack

The shared infrastructure changes from the BlueBubbles fix (session key
normalization in transcript.ts and fallback session entry creation in
outbound-session.ts) already cover Slack. Slack's sendMessageSlack uses
conversations.open to auto-create DM channels for new user targets.

Add tests confirming:
- Slack user DM and channel session route resolution (outbound.test.ts)
- Slack session key normalization for transcript append (sessions.test.ts)
- Slack outbound sendText/sendMedia to new user and channel targets (channel.test.ts)

* fix(cron): skip stale delayed deliveries

* fix: prep PR #50092
2026-03-19 11:40:34 +09:00
Vincent Koc ef1346e503 Plugin SDK: route reply payload through public subpath 2026-03-18 12:01:15 -07:00
Peter Steinberger 62edfdffbd refactor: deduplicate reply payload handling 2026-03-18 18:14:57 +00:00
Vincent Koc b3ca855283 Plugin SDK: use public whatsapp subpath 2026-03-18 09:37:54 -07:00
Peter Steinberger f6928617b7 test: stabilize gate regressions 2026-03-18 15:36:32 +00:00
Peter Steinberger 4b125762f6
refactor: clean extension api boundaries 2026-03-17 09:38:21 -07:00
Peter Steinberger f8d03022cf test: cover invalid main job store load 2026-03-17 07:06:25 +00:00
Peter Steinberger 5fb7a1363f fix: stabilize full gate 2026-03-17 07:06:25 +00:00
Peter Steinberger 9ebe38b6e3
refactor: untangle remaining plugin sdk boundaries 2026-03-16 21:16:32 -07:00
Peter Steinberger c64f6adc83
refactor: finish provider auth extraction and canonicalize kimi 2026-03-16 20:49:38 -07:00
Tak Hoffman 4863b651c6 docs: rename onboarding user-facing wizard copy
Co-authored-by: Tak <contact-redacted@example.com>
2026-03-16 19:50:31 -05:00
Josh Lehman eeb140b4f0
fix(plugins): late-binding subagent runtime for non-gateway load paths (#46648)
Merged via squash.

Prepared head SHA: 44742652c9
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-03-16 14:27:54 -07:00
Gustavo Madeira Santana 8ad8069854
Tests: fix green check typing regressions 2026-03-16 12:54:01 +00:00
Gustavo Madeira Santana d6aa9b516e
Cron: isolate active-model delivery tests 2026-03-16 11:52:49 +00:00
Peter Steinberger 7e74adef91
refactor: shrink public channel plugin sdk surfaces 2026-03-16 01:34:22 -07:00
Peter Steinberger f11589b311
refactor: tighten plugin sdk channel seams 2026-03-16 01:05:51 -07:00
Peter Steinberger e3ab0e174c
style(core): normalize rebase fallout 2026-03-16 00:12:43 -07:00