Commit Graph

3449 Commits

Author SHA1 Message Date
Peter Steinberger
f5938f8114 refactor: unify outbound delivery 2026-01-07 01:13:04 +00:00
Peter Steinberger
1ae5e9a26b feat: add docs search command 2026-01-07 02:03:06 +01:00
Peter Steinberger
e816991dc5 docs: update changelog and clawtributor list for PR #341 2026-01-07 01:46:37 +01:00
Erik
cd4e2023ab fix(agent): capture compaction retry AbortError for model fallback
Wrap waitForCompactionRetry() in try/catch to capture AbortError
that was escaping and bypassing the model fallback mechanism.

When a timeout fires, session.abort() causes both session.prompt()
and waitForCompactionRetry() to throw AbortError. Previously only
the prompt error was captured, allowing the compaction error to
escape to model-fallback.ts where it was immediately re-thrown
(line 199: isAbortError check), bypassing fallback model attempts.

Fixes #313
2026-01-07 01:44:37 +01:00
Peter Steinberger
5da8258614 fix: gateway:watch args 2026-01-07 00:37:32 +00:00
Peter Steinberger
0116184b1c docs: recommend WSL2 for Windows installs 2026-01-07 01:21:36 +01:00
Peter Steinberger
62112d9978 feat: add onboarding doc links 2026-01-07 01:19:31 +01:00
Peter Steinberger
19c95d0ff7 fix(auth): serialize profile stats updates 2026-01-07 01:06:51 +01:00
Peter Steinberger
96d72ff91e fix(auth): lock auth profile updates 2026-01-07 01:00:47 +01:00
Muhammed Mukhthar CM
eb5f758f6b fix(auth): improve multi-account round-robin rotation and 429 handling
This commit fixes several issues with multi-account OAuth rotation that
were causing slow responses and inefficient account cycling.

## Changes

### 1. Fix usageStats race condition (auth-profiles.ts)

The `markAuthProfileUsed`, `markAuthProfileCooldown`, `markAuthProfileGood`,
and `clearAuthProfileCooldown` functions were using a stale in-memory store
passed as a parameter. Long-running sessions would overwrite usageStats
updates from concurrent sessions when saving.

**Fix:** Re-read the store from disk before each update to get fresh
usageStats from other sessions, then merge the update.

### 2. Capture AbortError from waitForCompactionRetry (pi-embedded-runner.ts)

When a request timed out, `session.abort()` was called which throws an
`AbortError`. The code structure was:

```javascript
try {
  await session.prompt(params.prompt);
} catch (err) {
  promptError = err;  // Catches AbortError here
}
await waitForCompactionRetry();  // But THIS also throws AbortError!
```

The second `AbortError` from `waitForCompactionRetry()` escaped and
bypassed the rotation/fallback logic entirely.

**Fix:** Wrap `waitForCompactionRetry()` in its own try/catch to capture
the error as `promptError`, enabling proper timeout handling.

Root cause analysis and fix proposed by @erikpr1994 in #313.

Fixes #313

### 3. Fail fast on 429 rate limits (pi-ai patch)

The pi-ai library was retrying 429 errors up to 3 times with exponential
backoff before throwing. This meant a rate-limited account would waste
30+ seconds retrying before our rotation code could try the next account.

**Fix:** Patch google-gemini-cli.js to:
- Throw immediately on first 429 (no retries)
- Not catch and retry 429 errors in the network error handler

This allows the caller to rotate to the next account instantly on rate limit.

Note: We submitted this fix upstream (https://github.com/badlogic/pi-mono/pull/504)
but it was closed without merging. Keeping as a local patch for now.

## Testing

With 6 Antigravity accounts configured:
- Accounts rotate properly based on lastUsed (round-robin)
- 429s trigger immediate rotation to next account
- usageStats persist correctly across concurrent sessions
- Cooldown tracking works as expected

## Before/After

**Before:** Multiple 429 retries on same account, 30-90s delays
**After:** Instant rotation on 429, responses in seconds
2026-01-07 00:56:32 +01:00
Peter Steinberger
2871657ebe chore: make bun optional for source builds 2026-01-06 23:48:24 +00:00
Peter Steinberger
db4d0b8e75 docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00
Peter Steinberger
b8db8502aa docs: note discord voice message fix 2026-01-06 23:36:09 +00:00
VAC
ff200e3993 fix(discord): handle voice messages with empty content
Discord voice messages have empty `content` with the audio in attachments.
The nullish coalescing operator (`??`) doesn't fall through on empty strings,
so voice messages were being dropped as 'empty content'.

Changed to logical OR (`||`) so empty string falls through to media placeholder.
2026-01-06 23:35:30 +00:00
Peter Steinberger
44a954b36d docs: add Mintlify link rules 2026-01-06 23:32:18 +00:00
Peter Steinberger
3c1a2ff451 docs: normalize Mintlify links 2026-01-06 23:32:12 +00:00
Peter Steinberger
e62c8fb55c docs: clarify gmail pubsub tailscale requirement 2026-01-06 23:28:49 +00:00
Peter Steinberger
d09a5100b6 docs: rewrite provider docs 2026-01-07 00:25:16 +01:00
Peter Steinberger
7214cf39ec fix: prefer home linuxbrew paths 2026-01-07 00:18:07 +01:00
Peter Steinberger
b57d36f49c fix(sessions_spawn): hard-fail invalid model overrides 2026-01-06 23:17:35 +00:00
Azade
0429a4b63b test(sessions_spawn): add test for model parameter 2026-01-06 23:17:35 +00:00
Azade
274f408e6f feat(sessions_spawn): add model parameter for sub-agent model override 2026-01-06 23:17:35 +00:00
Peter Steinberger
02c9cf0ff4 chore: remove duplicate daemon runtime imports 2026-01-07 00:14:08 +01:00
Peter Steinberger
198515397c docs(commands): mention /stop 2026-01-06 23:11:57 +00:00
Peter Steinberger
dd0d23cd96 test(commands): add /stop native regression 2026-01-06 23:11:57 +00:00
Peter Steinberger
e0efcda77f fix(commands): wire /stop across chat commands 2026-01-06 23:11:57 +00:00
Nacho Iacovino
0df7c3addf feat(telegram): add /stop command to abort running agent
Adds a /stop command that:
- Can interrupt a running agent session mid-execution
- Works in both DMs and group chats (including forum topics)
- Uses grammy's bot.command() to run before the main message handler
- Returns status: stopped, stop requested, or nothing running

Also fixes session key lookup in pi-embedded-runner to use sessionKey
instead of sessionId, ensuring /stop finds the correct active run.
2026-01-06 23:11:57 +00:00
Peter Steinberger
5bc3f13b46 feat: colorize models auth key labels 2026-01-07 00:10:01 +01:00
Peter Steinberger
b357746e1c feat: add richer color to models output 2026-01-07 00:07:50 +01:00
Peter Steinberger
79f813e18e style: format lint offenders 2026-01-07 00:04:44 +01:00
Peter Steinberger
fb321afa1d docs: fix himalaya query usage 2026-01-07 00:04:18 +01:00
Peter Steinberger
d99fc89790 docs: add agent workspace guide 2026-01-07 00:04:03 +01:00
Peter Steinberger
0ad74ee941 test: mock select prompt in doctor tests 2026-01-07 00:01:50 +01:00
Peter Steinberger
d6eae275b1 fix: remove duplicate runtime note 2026-01-06 23:55:39 +01:00
Peter Steinberger
86b87682df docs: refine model recommendation wording 2026-01-06 23:53:53 +01:00
Peter Steinberger
658ca205a9 docs: add model redirect and clarify guidance 2026-01-06 23:52:51 +01:00
Peter Steinberger
6d4cc28c4c docs: link AgentSkills + ClawdHub guide 2026-01-06 23:51:01 +01:00
Peter Steinberger
55278c1c71 feat: add daemon runtime prompts 2026-01-06 23:51:00 +01:00
Peter Steinberger
edfc71a47e docs: update model guidance 2026-01-06 23:48:25 +01:00
Peter Steinberger
c920ee1166 Merge branch 'pr-335-merge' 2026-01-06 23:45:35 +01:00
Peter Steinberger
ea216994a1 docs: polish himalaya skill docs 2026-01-06 23:44:06 +01:00
Dante Lex
16243b7edc fix: simplify install to brew-only
Remove cargo install option to avoid confusing the model with
multiple installation methods.
2026-01-06 23:41:46 +01:00
Dante Lex
e6d6c822c5 feat: add himalaya email CLI skill
Add skill for Himalaya (https://github.com/pimalaya/himalaya), a CLI
email client supporting IMAP, SMTP, Notmuch, and Sendmail backends.

Includes:
- SKILL.md with common operations (list, read, reply, forward, send)
- Configuration reference for Gmail, iCloud, and generic IMAP/SMTP
- MML (MIME Meta Language) composition guide for attachments

Tested with iCloud IMAP account - verified folder listing, email
reading, and sending work correctly.
2026-01-06 23:41:46 +01:00
Peter Steinberger
5939363eed fix: include telegram group sender in envelope headers 2026-01-06 22:34:02 +00:00
Peter Steinberger
825a692390 docs: add cron redirect 2026-01-06 22:32:01 +00:00
Peter Steinberger
8d50d08936 style: format daemon runtime changes 2026-01-06 23:29:38 +01:00
Peter Steinberger
8911a79d7f docs: rewrite cron jobs guide and heartbeat notes 2026-01-06 22:28:42 +00:00
Peter Steinberger
4e6fcd1678 docs: link bun websocket issue 2026-01-06 23:28:42 +01:00
Peter Steinberger
707f7918bc feat: add gateway daemon runtime selector 2026-01-06 23:27:58 +01:00
Peter Steinberger
18c43fe462 fix: bootstrap linuxbrew for skills 2026-01-06 23:27:38 +01:00