Fixes#652
When cron jobs with sessionTarget:"main" have wakeMode:"now",
they were being marked as completed immediately without waiting for the
agent to actually process the system event.
The issue was that requestHeartbeatNow() is fire-and-forget and
doesn't wait for the heartbeat to complete. The job would finish
with durationMs: 0 before the agent had a chance to run.
This fix:
- Adds runHeartbeatOnce to CronServiceDeps
- Wires it up in gateway/server.ts to load config and pass runtime
- Modifies executeJob() to call runHeartbeatOnce when wakeMode:"now"
- Waits for heartbeat to complete and maps status to cron result:
* "ran" → "ok"
* "skipped" → "skipped"
* "failed" → "error"
- Falls back to old behavior for wakeMode:"next-heartbeat" or if
runHeartbeatOnce is not available (backward compatibility)
Benefits:
- Jobs now have accurate durationMs reflecting actual processing time
- Jobs are correctly marked with "error" status if heartbeat fails
- Prevents race condition where job completes before agent runs
[AI-assisted] - Generated with z.ai GLM-4.7
[Tested: Lightly tested - Logic validated with test scenarios, code quality checks passed, integration testing requires live Clawdbot instance]
- Replace model catalog with 11 current models: gpt-5.1-codex, claude-opus-4-5,
gemini-3-pro, alpha-glm-4.7, gpt-5.1-codex-mini, gpt-5.1, glm-4.7-free,
gemini-3-flash, gpt-5.1-codex-max, minimax-m2.1-free, gpt-5.2
- Add accurate per-token costs from OpenCode Zen pricing
- Add accurate context windows and output limits
- Update aliases for new model families (codex, glm, minimax)
- Remove deprecated models (sonnet, haiku, o-series, gemini-2.5)
- Expand schema scrubber to strip additional constraint keywords rejected
by Cloud Code Assist (examples, minLength, maxLength, minimum, maximum,
multipleOf, pattern, format, minItems, maxItems, uniqueItems,
minProperties, maxProperties)
- Extend tool call ID sanitization to cover toolUse and toolCall block
types (previously only functionCall was sanitized)
- Update pi-tools test to include 'examples' in unsupported keywords
Fixes 400 errors when using google-antigravity/claude-opus-4-5-thinking:
- tools.N.custom.input_schema: JSON schema is invalid
- messages.N.content.N.tool_use.id: String should match pattern
Both node-pairing.ts and voicewake.ts were using a local defaultBaseDir()
that hardcoded ~/.clawdbot, ignoring CLAWDBOT_STATE_DIR.
This caused nodes/paired.json and settings/voicewake.json to be stored
in ~/.clawdbot instead of the configured state directory.
Fixes the bug where paired nodes config was stored in a different
location than the rest of the gateway state.
Adds `agent.humanDelay` config option to create natural rhythm between
streamed message bubbles. When enabled, introduces a random delay
(default 800-2500ms) between block replies, making multi-message
responses feel more like natural human texting.
Config example:
```json
{
"agent": {
"blockStreamingDefault": "on",
"humanDelay": {
"enabled": true,
"minMs": 800,
"maxMs": 2500
}
}
}
```
- First message sends immediately
- Subsequent messages wait a random delay before sending
- Works with iMessage, Signal, and Discord providers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Applies the same Swift 6 compatibility patterns from PR #166 (macOS) to the iOS app.
Changes:
- LocationService.swift: Added Sendable constraint to withTimeout<T> generic,
made CLLocationManagerDelegate methods nonisolated with Task { @MainActor in }
pattern to safely access MainActor state
- TalkModeManager.swift: Fixed OSLog string interpolation to avoid operator
overload issues with OSLogMessage in Swift 6
Addresses #164
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>