Commit Graph

145 Commits

Author SHA1 Message Date
Peter Steinberger
050c1c5391 fix(agents): include reasoningLevel in compaction params 2026-01-10 22:39:06 +01:00
Peter Steinberger
6d70524aa8 fix: add reasoning visibility hint 2026-01-10 22:24:22 +01:00
Peter Steinberger
ab314a22e0 chore: refresh pi-ai patch repro note 2026-01-10 20:55:57 +00:00
Peter Steinberger
46e00ad5e7 fix: describe sandboxed elevated in prompt 2026-01-10 21:37:15 +01:00
Peter Steinberger
9f9098406c feat(sandbox): add sandbox explain inspector 2026-01-10 20:28:43 +01:00
Peter Steinberger
212b13b099 fix: repair tool-use history for anthropic 2026-01-10 19:15:57 +00:00
cristip73
c4e76eb635 fix: enable image attachments in chat messages for Claude API
Images were previously converted to markdown data URLs which Claude API
treats as plain text, not as actual images.

Changes:
- Add parseMessageWithAttachments() that returns {message, images[]}
- Pass images through the stack to session.prompt() as content blocks
- Filter null/empty attachments before parsing
- Strip data URL prefix if client sends it

This enables iOS and other clients to send images that Claude can actually see.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 20:00:25 +01:00
Peter Steinberger
651a9e9be4 fix: restore minimax tool calling 2026-01-10 18:15:15 +00:00
Muhammed Mukhthar CM
de5b75eff6 fix(tools): resolve Read/Write/Edit paths against workspace directory
Previously, Read/Write/Edit tools used the global tool instances from
pi-coding-agent which had process.cwd() baked in at import time. Since
the gateway starts from /root/dev/ai/clawdbot, relative paths like
'SOUL.md' would incorrectly resolve there instead of the agent's
workspace (/root/clawd).

This fix:
- Adds workspaceDir option to createClawdbotCodingTools
- Creates fresh Read/Write/Edit tools bound to workspaceDir
- Adds cwd option to Bash tool defaults for consistency
- Passes effectiveWorkspace from pi-embedded-runner

Absolute paths and ~/... paths are unaffected. Sandboxed sessions
continue to use sandbox root as before.

Includes tests for Read/Write/Edit workspace path resolution.
2026-01-10 17:08:56 +01:00
Peter Steinberger
70c1732dd1 refactor: centralize messaging dedupe helpers 2026-01-10 16:02:56 +01:00
Peter Steinberger
cc1c5f800f fix(tools): harden schemas and oauth tool names 2026-01-10 03:05:56 +00:00
Peter Steinberger
8466e53b5d fix: restore Anthropic OAuth tool dispatch 2026-01-10 04:01:00 +01:00
Peter Steinberger
f28a4a34ad refactor: unify inline directives and media fetch 2026-01-10 03:01:04 +01:00
Peter Steinberger
a29f5dda2e test(live): gateway smoke across profile-key models 2026-01-10 01:09:41 +00:00
Peter Steinberger
623d1e11f1 refactor: centralize session agent resolution 2026-01-10 01:57:54 +01:00
Peter Steinberger
f4b3869f45 Merge pull request #490 from jarvis-medmatic/feat/audio-as-voice-tag
feat(telegram): `[[audio_as_voice]]` tag support
2026-01-10 00:52:02 +00:00
Peter Steinberger
c56b2f4bc1 fix: honor audio_as_voice streaming + parse tests (#490) (thanks @jarvis-medmatic) 2026-01-10 01:50:33 +01:00
Peter Steinberger
cb10682d3e fix(openai): avoid invalid reasoning replay 2026-01-10 00:45:10 +00:00
Jarvis
5fedfd8d15 chore: format audioAsVoice updates
Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:44:57 +01:00
Jarvis
8c7d1781bc fix(pi): preserve audio_as_voice tag
- Allow flag-only chunks so audio_as_voice propagates
- Keep reply item scan aware of empty audio tag blocks

Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:43:51 +01:00
Jarvis
05a99aa49b feat(telegram): buffer audio blocks for [[audio_as_voice]] tag support
- Add [[audio_as_voice]] detection to splitMediaFromOutput()
- Pass audioAsVoice through onBlockReply callback chain
- Buffer audio blocks during streaming, flush at end with correct flag
- Non-audio media still streams immediately
- Fix: emit payloads with audioAsVoice flag even if text is empty

Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:41:18 +01:00
Peter Steinberger
43975a39dc fix: gate heartbeat prompt to default agent sessions (#630) (thanks @adam91holt) 2026-01-10 01:32:58 +01:00
Adam Holt
c91ec2aab7 fix: only inject heartbeat prompt for default agent
The heartbeat prompt from agents.defaults.heartbeat.prompt was being
injected into the system prompt for ALL agents, causing non-default
agents to read the default agent's identity files and adopt its persona.

Now the heartbeat prompt is only included when the session's agent ID
matches the configured default agent. Other agents receive no heartbeat
section in their system prompt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 01:32:30 +01:00
Peter Steinberger
5898304fa0 fix: abort runs between tool calls 2026-01-10 01:26:25 +01:00
Peter Steinberger
53ec8e36cb refactor: centralize failover error parsing 2026-01-10 01:26:06 +01:00
Peter Steinberger
08015fbce6 Merge pull request #544 from jeffersonwarrior/fix/cloud-code-assist-api-errors
Fix Cloud Code Assist API errors (429/400)
2026-01-10 00:13:46 +00:00
Peter Steinberger
251ed83680 fix: harden Cloud Code Assist failover (#544) (thanks @jeffersonwarrior) 2026-01-10 01:12:46 +01:00
Peter Steinberger
d75b302699 style: fix pi-embedded-runner formatting (#623) (thanks @magimetal) 2026-01-10 01:12:22 +01:00
Jefferson Warrior
5843733978 Fix Cloud Code Assist API errors (429/400)
- Enhanced rate limit detection for Cloud Code Assist quota exhaustion
- Added tool call ID sanitization to fix invalid request format errors
- Integrated Cloud Code Assist format error detection into failover system
- Added comprehensive error pattern matching for Cloud Code Assist APIs

Fixes #cloud-code-assist-api-errors
2026-01-10 01:10:23 +01:00
Peter Steinberger
9b1f164447 fix: guard small context windows 2026-01-10 01:08:56 +01:00
Peter Steinberger
21eebb6d3b fix: limit subagent bootstrap context 2026-01-10 00:01:16 +00:00
Peter Steinberger
e311dc82e0 refactor: centralize reasoning tag handling 2026-01-10 00:53:48 +01:00
Peter Steinberger
51ec578cec fix: suppress <think> leakage + split reasoning output (#614) (thanks @zknicker) 2026-01-10 00:02:13 +01:00
Peter Steinberger
c37b77855b Merge pull request #464 from austinm911/fix/slack-thread-replies
feat(slack): implement configurable reply threading
2026-01-09 21:10:39 +00:00
Peter Steinberger
c27b1441f7 fix(auth): billing backoff + cooldown UX 2026-01-09 22:00:14 +01:00
Austin Mudd
b4663ed11c Slack: implement replyToMode threading for tool path
- Add shared hasRepliedRef state between auto-reply and tool paths
- Extract buildSlackThreadingContext helper in agent-runner.ts
- Extract resolveThreadTsFromContext helper in slack-actions.ts
- Update docs with clear replyToMode table (off/first/all)
- Add tests for first mode behavior across multiple messages
2026-01-09 21:59:51 +01:00
Peter Steinberger
374aa856f2 refactor(agents): centralize failover handling 2026-01-09 21:31:18 +01:00
Peter Steinberger
24605379b9 refactor: centralize skills prompt resolution 2026-01-09 21:27:20 +01:00
Peter Steinberger
4861f09f78 fix: inject skills prompt list 2026-01-09 21:20:51 +01:00
Peter Steinberger
65cb9dc3f7 fix(agents): fail over on billing/credits errors 2026-01-09 21:17:07 +01:00
Peter Steinberger
6d378ee608 feat(telegram): inline keyboard buttons (#491)
Co-authored-by: Azade <azade@hey.com>
2026-01-09 20:47:03 +01:00
Peter Steinberger
7b81d97ec2 feat: wire multi-agent config and routing
Co-authored-by: Mark Pors <1078320+pors@users.noreply.github.com>
2026-01-09 12:48:42 +00:00
Peter Steinberger
aa5e75e853 fix: align tool rename fallout 2026-01-09 05:54:34 +01:00
Claude
333832c2e1 fix: bypass Anthropic OAuth token blocking for tool names
Anthropic blocks specific lowercase tool names (bash, read, write, edit)
when using OAuth tokens. This fix:

1. Renames blocked tools to capitalized versions (Bash, Read, Write, Edit)
   in pi-tools.ts via renameBlockedToolsForOAuth()

2. Passes all tools as customTools in splitSdkTools() to bypass
   pi-coding-agent's built-in tool filtering, which expects lowercase names

The capitalized names work with both OAuth tokens and regular API keys.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:48:54 +01:00
Peter Steinberger
8930ec32cb feat: add slack multi-account routing 2026-01-08 08:49:16 +01:00
Peter Steinberger
35759e409a fix(ci): harden windows tests 2026-01-08 03:19:43 +00:00
mneves75
f7b32195cb feat(agent): auto-enable GLM-4.7 thinking mode
Add automatic thinking mode support for Z.AI GLM-4.x models:
- GLM-4.7: Preserved thinking (clear_thinking: false)
- GLM-4.5/4.6: Interleaved thinking (clear_thinking: true)

Uses Z.AI Cloud API format: thinking: { type: "enabled", clear_thinking: boolean }

Includes patches for pi-ai, pi-agent-core, and pi-coding-agent to pass
extraParams through the stream pipeline. User can override via config
or disable via --thinking off.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 04:10:56 +01:00
Peter Steinberger
cad853b547 refactor: rebuild agent system prompt 2026-01-08 02:20:30 +01:00
Peter Steinberger
17d052bcda fix: polish reply threading + tool dedupe (thanks @mneves75) (#326) 2026-01-08 00:50:47 +00:00
mneves75
33e2d53be3 feat(telegram): wire replyToMode config, add forum topic support, fix messaging tool duplicates
Changes:
- Default replyToMode from "off" to "first" for better threading UX
- Add messageThreadId and replyToMessageId params for forum topic support
- Add messaging tool duplicate detection to suppress redundant block replies
- Add sendMessage action to telegram tool schema
- Add @grammyjs/types devDependency for proper TypeScript typing
- Remove @ts-nocheck and fix all type errors in send.ts
- Add comprehensive docs/telegram.md documentation
- Add PR-326-REVIEW.md with John Carmack-level code review

Test coverage:
- normalizeTextForComparison: 5 cases
- isMessagingToolDuplicate: 7 cases
- sendMessageTelegram thread params: 5 cases
- handleTelegramAction sendMessage: 4 cases
- Forum topic isolation: 4 cases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:50:47 +00:00