Commit Graph

3533 Commits

Author SHA1 Message Date
Peter Steinberger
e70ff671f5 chore(cli): polish provider onboarding notes 2026-01-07 22:22:21 +01:00
Peter Steinberger
322c5dd936 refactor(telegram): extract runner config and key helper 2026-01-07 22:22:21 +01:00
Peter Steinberger
98d4e8034d refactor(agent): centralize google turn-order fixup 2026-01-07 22:08:22 +01:00
Peter Steinberger
068b1872fa fix(telegram): sequence runner updates and cap concurrency 2026-01-07 22:08:20 +01:00
Peter Steinberger
315b0938e3 fix(types): avoid typebox schema mismatch in embedded runner 2026-01-07 22:08:20 +01:00
Muhammed Mukhthar CM
ee99311130 test(telegram): mock grammyjs/runner for fast tests 2026-01-07 22:08:20 +01:00
Muhammed Mukhthar CM
1a41fecf67 feat(telegram): use grammyjs/runner for concurrent update processing
Previously, grammY's default bot.start() processed updates sequentially,
blocking all Telegram messages while one was being handled. This made
maxConcurrent settings ineffective for Telegram.

Now uses @grammyjs/runner which processes updates concurrently, matching
the behavior of Discord (Promise.all) and WhatsApp (fire-and-forget).

Benefits:
- Ack reactions (👀) appear immediately, not after queue clears
- Multiple chats can be processed in parallel
- maxConcurrent setting now works correctly for Telegram
- Long-running tool calls no longer block other conversations
2026-01-07 22:08:20 +01:00
Peter Steinberger
9bd439892f refactor: centralize unhandled rejection setup 2026-01-07 20:59:49 +00:00
Peter Steinberger
fd3babc626 fix: keep bonjour rejection handler through shutdown 2026-01-07 20:54:40 +00:00
Emanuel Stadler
9056e0edbb Bonjour: ignore ciao cancellation rejections 2026-01-07 20:51:54 +00:00
Peter Steinberger
d6608196d4 chore: sort google helper test imports 2026-01-07 21:49:40 +01:00
Jonáš Jančařík
974619d285 fix(google): repair Cloud Code Assist tool-call ordering (#406) 2026-01-07 21:49:40 +01:00
Peter Steinberger
7ce1f635cd fix(commands): harden model alias parsing 2026-01-07 20:41:41 +00:00
Azade
bb29a3ee3f fix: filter reserved commands from model aliases + add tests 2026-01-07 20:41:41 +00:00
Azade
e41540e4ff feat(commands): add dynamic /<alias> model switching 2026-01-07 20:41:41 +00:00
Peter Steinberger
391a3d6eaf feat: add daemon service management 2026-01-07 21:37:13 +01:00
Peter Steinberger
7aeb6d5921 fix(wizard): keep WhatsApp config setters typed 2026-01-07 20:32:15 +00:00
Peter Steinberger
54960d1380 fix: refine whatsapp personal phone onboarding 2026-01-07 20:49:58 +01:00
Peter Steinberger
ef644b8369 fix: suppress whatsapp pairing in self-phone mode 2026-01-07 20:49:58 +01:00
Peter Steinberger
797b70e854 Merge remote-tracking branch 'origin/main' 2026-01-07 20:11:32 +01:00
Peter Steinberger
d81cb886ce fix: polish thread session routing 2026-01-07 20:09:57 +01:00
Peter Steinberger
43c7f5036a fix(tools): keep tool errors concise 2026-01-07 19:08:13 +00:00
alejandro maza
579828b2d5 Handle 413 context overflow errors gracefully
When the conversation context exceeds the model's limit, instead of
throwing an opaque error or returning raw JSON, we now:

1. Detect context overflow errors (413, request_too_large, etc.)
2. Return a user-friendly message explaining the issue
3. Suggest using /new or /reset to start fresh

This prevents the assistant from becoming completely unresponsive
when context grows too large (e.g., from many screenshots or long
tool outputs).

Addresses issue #394
2026-01-07 19:08:13 +00:00
Shadow
d4bba937a0 Threads: add Slack/Discord thread sessions 2026-01-07 20:05:58 +01:00
Peter Steinberger
cb9f8146c4 refactor: centralize thread helpers 2026-01-07 20:01:19 +01:00
Peter Steinberger
42b637bbc8 test: cover thread session routing 2026-01-07 19:50:17 +01:00
Peter Steinberger
8584bcd2f6 Merge remote-tracking branch 'origin/main' 2026-01-07 19:44:26 +01:00
Peter Steinberger
0d021391a9 fix: scope thread sessions and discord starter fetch 2026-01-07 19:42:50 +01:00
Peter Steinberger
aba4695cd1 test(status): cover model override display 2026-01-07 18:38:55 +00:00
Azade
2b09cb3d9f fix(status): show configured model instead of last-run model 2026-01-07 18:37:42 +00:00
Shadow
7e5cef29a0 Threads: add Slack/Discord thread sessions 2026-01-07 19:30:30 +01:00
Emanuel Stadler
7f4248e5e0 Cron: clamp timer to avoid TimeoutOverflowWarning 2026-01-07 19:25:18 +01:00
Max Sumrall
5ddf9b2c65 fix(agent): protect bootstrap prefix from pruning 2026-01-07 18:17:18 +00:00
Peter Steinberger
c3b3f571e9 fix(tools): finalize Vertex schema flattening (#409) 2026-01-07 17:54:19 +00:00
Kit
a2b3f2c18a fix(tools): flatten nested anyOf schemas for Vertex AI compatibility
Claude API on Vertex AI (Cloud Code Assist) rejects nested anyOf schemas
as invalid JSON Schema draft 2020-12. This change:

- Add tryFlattenLiteralAnyOf() to convert Type.Union([Type.Literal(...)])
  patterns from anyOf with const values to flat enum arrays
- Update stringEnum helper in bash-tools to use Type.Unsafe with flat enum
- Flatten BrowserActSchema from discriminated union to single object
- Simplify TelegramToolSchema to use Type.String() for IDs

Fixes 400 errors when sending messages through WhatsApp/Telegram providers.
2026-01-07 17:51:16 +00:00
Peter Steinberger
de55f4e111 fix: add provider retry policy 2026-01-07 17:48:19 +00:00
Max Sumrall
f9118bd21c test(agent): cover context pruning 2026-01-07 18:00:14 +01:00
Max Sumrall
eeaa6ea46f feat(agent): opt-in tool-result context pruning 2026-01-07 18:00:14 +01:00
Peter Steinberger
937e0265a3 fix: preserve sessionKey for agent runs 2026-01-07 17:53:59 +01:00
Peter Steinberger
573fe74a9c fix: per-agent sandbox overrides 2026-01-07 17:31:40 +01:00
sheeek
22db83a04c test(tools): add tests for agent-specific tool filtering
Add 5 tests for agent-specific tool restrictions:
- Apply global tool policy when no agent-specific policy exists
- Apply agent-specific tool policy
- Allow different tool policies for different agents
- Combine global and agent-specific deny lists
- Work with sandbox tools filtering

All tests pass.
2026-01-07 17:31:40 +01:00
sheeek
1178c65226 test(sandbox): add tests for agent-specific sandbox override
Add 6 tests for agent-specific sandbox configuration:
- Use global sandbox config when no agent-specific config exists
- Override with agent-specific sandbox mode 'off'
- Use agent-specific sandbox mode 'all'
- Use agent-specific scope
- Use agent-specific workspaceRoot
- Prefer agent config over global for multiple agents

All tests pass.
2026-01-07 17:31:40 +01:00
sheeek
5a51a9b0d6 test(agent-scope): add tests for sandbox and tools config resolution
Add 7 tests for resolveAgentConfig():
- Return undefined when no agents config exists
- Return undefined when agent id does not exist
- Return basic agent config (name, workspace, agentDir, model)
- Return agent-specific sandbox config
- Return agent-specific tools config
- Return both sandbox and tools config
- Normalize agent id

All tests pass.
2026-01-07 17:31:40 +01:00
sheeek
a8c153ec78 feat(tools): add agent-specific tool filtering
Add tool filtering layer for per-agent restrictions:
- Extract agentId from sessionKey
- Load routing.agents[agentId].tools via resolveAgentConfig()
- Apply agent-specific allow/deny before sandbox filtering

Filtering order:
1. Global (agent.tools)
2. Agent-specific (routing.agents[id].tools) ← NEW
3. Sandbox (agent.sandbox.tools)
4. Subagent policy

This enables different tool permissions per agent
(e.g., main: all tools, family: read only).
2026-01-07 17:31:40 +01:00
sheeek
a375a81919 feat(sandbox): support agent-specific sandbox config override
Changes to defaultSandboxConfig():
- Add optional agentId parameter
- Load routing.agents[agentId].sandbox if available
- Prefer agent-specific settings over global agent.sandbox

Update callers in resolveSandboxContext() and
ensureSandboxWorkspaceForSession() to extract agentId
from sessionKey and pass it to defaultSandboxConfig().

This enables per-agent sandbox modes (e.g., main: off, family: all).
2026-01-07 17:31:40 +01:00
sheeek
ebd96f2971 feat(agent-scope): extend resolveAgentConfig to return sandbox and tools
Return newly added fields from routing.agents config:
- sandbox: agent-specific sandbox configuration
- tools: agent-specific tool restrictions

This makes per-agent sandbox and tool settings accessible
to other parts of the codebase.
2026-01-07 17:31:40 +01:00
sheeek
90cdccee1e feat(config): add Zod validation for routing.agents sandbox and tools
Validate per-agent sandbox config:
- mode: 'off' | 'non-main' | 'all'
- scope: 'session' | 'agent' | 'shared'
- perSession: boolean
- workspaceRoot: string

Validate per-agent tools config:
- allow: string[]
- deny: string[]
2026-01-07 17:31:40 +01:00
sheeek
c115918c97 feat(types): add sandbox and tools fields to routing.agents
Add optional per-agent configuration:
- sandbox: { mode, scope, perSession, workspaceRoot }
- tools: { allow, deny }

These will allow agents to override global agent.sandbox and
agent.tools settings.
2026-01-07 17:31:40 +01:00
Peter Steinberger
77024cf776 fix(agents): make sessions_spawn non-blocking 2026-01-07 16:14:25 +00:00
Peter Steinberger
53c037a197 style(telegram): format activation log 2026-01-07 11:21:12 +00:00