Commit Graph

1500 Commits

Author SHA1 Message Date
Peter Steinberger
29ff9af620 fix(tools): finalize Vertex schema flattening (#409) 2026-01-07 17:54:19 +00:00
Kit
f0a974b9a5 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
44aea56b51 fix: add provider retry policy 2026-01-07 17:48:19 +00:00
Max Sumrall
5f74e05b7d test(agent): cover context pruning 2026-01-07 18:00:14 +01:00
Max Sumrall
f6f57952d6 feat(agent): opt-in tool-result context pruning 2026-01-07 18:00:14 +01:00
Peter Steinberger
2c7e0b3138 fix: preserve sessionKey for agent runs 2026-01-07 17:53:59 +01:00
Peter Steinberger
66f0779874 fix: per-agent sandbox overrides 2026-01-07 17:31:40 +01:00
sheeek
fbc2c167e3 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
b989192287 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
5ac49b43b0 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
cf039e4fea 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
f9ba3cc554 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
c5f72b52a5 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
0f8015f125 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
9b6032274e 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
cc5df79bb8 fix(agents): make sessions_spawn non-blocking 2026-01-07 16:14:25 +00:00
Peter Steinberger
639e14b476 style(telegram): format activation log 2026-01-07 11:21:12 +00:00
Peter Steinberger
6313b7c532 fix(telegram): honor session activation overrides 2026-01-07 11:19:09 +00:00
Peter Steinberger
69d070bf9e test(telegram): cover routed activation 2026-01-07 11:17:12 +00:00
Julian Engel
0d8b0bf04d fix(telegram): make /activation command work by checking session state
The /activation command now properly controls group activation mode:
- Loads session state before filtering messages
- Checks groupActivation field (from /activation command)
- Falls back to config telegram.groups requireMention setting

Previously, the bot only checked config and ignored session state,
making the /activation command appear to work but have no effect.

Changes:
- Add resolveGroupActivation() to check session before config
- Import loadSessionStore to read session state early
- Pass messageThreadId to support forum topics correctly
2026-01-07 11:16:35 +00:00
Peter Steinberger
bf607f8f33 refactor: drop autoReply, add topic requireMention
Co-authored-by: kitze <kristijan.mkd@gmail.com>
2026-01-07 12:07:15 +01:00
Peter Steinberger
433ad58e88 chore: satisfy lint 2026-01-07 11:49:01 +01:00
Peter Steinberger
2c5db12a8d feat: add channel/topic overrides for skills + auto-reply 2026-01-07 11:44:37 +01:00
Peter Steinberger
a03f697dd8 feat: add skill filter + group system prompt plumbing 2026-01-07 11:44:37 +01:00
Peter Steinberger
82458c2e9f feat: add provider usage tracking 2026-01-07 11:42:46 +01:00
Josh Palmer
43b8c105ce Merge pull request #378 from timkrase/system-prompt-weekday
Agents: add weekday to user time (codex assisted)
2026-01-07 11:27:07 +01:00
Peter Steinberger
9d469d5ffa feat: telegram draft streaming 2026-01-07 11:08:32 +01:00
Peter Steinberger
1981086f7a fix: refine bootstrap injections 2026-01-07 10:04:23 +00:00
Tobias Bischoff
4ae7b2bac6 Reduce prompt token overhead with leaner context injections 2026-01-07 10:04:23 +00:00
Tim Krase
4177577e22 Agents: add weekday to user time 2026-01-07 11:02:39 +01:00
Peter Steinberger
138eb913e1 feat(auth): sync OAuth from Claude/Codex CLIs
Add source profiles anthropic:claude-cli and openai-codex:codex-cli; surface them in onboarding/configure.

Co-authored-by: pepicrft <pepicrft@users.noreply.github.com>
2026-01-07 10:47:57 +01:00
Peter Steinberger
6e72501384 feat(sandbox): add workspace access mode 2026-01-07 09:33:38 +00:00
Peter Steinberger
be1213e167 fix: clean agents lint warnings 2026-01-07 10:13:03 +01:00
Peter Steinberger
791d7ab563 feat: add agents command 2026-01-07 10:03:53 +01:00
Peter Steinberger
95f44c7d3c fix(discord): handle multi-attachment inbound media 2026-01-07 09:01:57 +01:00
Peter Steinberger
c08524f036 fix: ensure output for non-streaming models (#369)
Co-authored-by: mneves75 <mneves75@users.noreply.github.com>
2026-01-07 07:47:18 +00:00
Peter Steinberger
817c9c807b fix: land PR #350 2026-01-07 07:19:48 +00:00
Peter Steinberger
b8c8a9551d fix: align heartbeat session store with default agent 2026-01-07 07:14:24 +00:00
Peter Steinberger
55bbd24d9c fix(auth): harden legacy auth.json cleanup 2026-01-07 06:51:17 +00:00
Peter Steinberger
bbd3d6a1a5 Merge PR #368: delete legacy auth.json after migration 2026-01-07 06:47:46 +00:00
Peter Steinberger
e426066d84 fix(auth): doctor-migrate anthropic oauth profiles 2026-01-07 06:31:02 +00:00
Randy Torres
c13292320e fix(auth): use anthropic oauth email profile
Use Anthropic OAuth profile email as the profile identifier when available. This fixes cases where Anthropic returns an email-based profile id rather than an explicit id field.
2026-01-07 06:31:02 +00:00
Peter Steinberger
2bfeeb3e83 fix: split status activation line 2026-01-07 07:26:52 +01:00
Peter Steinberger
147945feca fix: refresh status output 2026-01-07 07:22:06 +01:00
Matthew Dicembrino
b042fc65eb fix: delete legacy auth.json after migration to prevent stale token overwrites (#363) 2026-01-07 01:15:38 -05:00
Peter Steinberger
1b4f73a375 fix: honor sandboxed built-in tools 2026-01-07 06:12:56 +00:00
Peter Steinberger
afbd2f4846 fix: order reasoning before reply text 2026-01-07 07:05:07 +01:00
Peter Steinberger
bd6d87dc26 feat: update subagent announce + archive 2026-01-07 06:53:01 +01:00
Peter Steinberger
f6180e2111 feat: add /reasoning reasoning visibility 2026-01-07 06:17:31 +01:00
Peter Steinberger
d1323dc835 test(routing): add route-reply coverage 2026-01-07 05:07:53 +00:00