v1.3.178
v1.3.178
Release date: 2026-07-24
Summary
Full codebase review round: security hardening, architectural cleanup, test coverage expansion, and diagnostic logging improvements. 18 commits across 28 files (+3,703 / -1,712 lines).
New Features
code_executiontool (PTC): Programmatic tool calling via embedded JavaScript runtime — allows the agent to batch-call read-only tools in a sandboxed VM, reducing round-trips for multi-step analysis- AppleScript dangerous command detection: 13 new patterns in
dangerous.gocoveringdo shell scriptwith dangerous payloads, Keychain access (security find/delete-generic-password), and reverse shell vianc -e - Generic IM panel framework:
im_panel_generic.go(782 lines) with per-adapter config registry — foundation for eliminating ~10K lines of duplicated panel code - i18n translation completeness check: Automated test that detects missing translation keys across all languages
Improvements
- daemon.go split (2268→1586 lines): Monolithic file split into 5 focused files by responsibility (tunnel, platform, session, runtime, lifecycle)
- Permission mode switch logging:
debug.Logfor both Shift+Tab cycling and/modecommand — enables tracing security-relevant mode changes - Tool execution error logging:
debug.LogwhensafeExecutereturns Go error — was previously only forwarded to LLM without diagnostic trace - TUI/desktop/mobile label for code_execution: Platform-specific display in tool descriptions
Bug Fixes
- Chat ID counter race condition:
chatIDCounterandassistantCounterused non-atomic increment whilesysIDCounterin the same file usedatomic.AddInt64— now all three use atomic operations - PTY reader goroutine safety: Bare
go func()withoutsafego.Recoverreplaced withsafego.Go - TestShutdownAll_WithSubAgents race: Test checked sub-agent status synchronously after async
CancelAll— added polling loop matching existing pattern - Hooks HTTP timeout validation: Validate
timeout > 0to prevent instant deadline - PTC tool bridge panic recovery: Added
safego.Recoverto JavaScript↔Go bridge functions
Test Coverage
- permission package: +1,286 lines of tests (dangerous command patterns, path traversal in all modes, AppleScript detection, mode switching behavior)
- Removed 25 dead tunnel tests: Skipped since TunnelHost refactor, core functionality covered by 17 active tests in
agentruntime/ - i18n completeness: Found zh missing 4 keys, ja missing 38, other languages 52-179
Code Cleanup
- Removed 1,011 lines of dead test code (skipped tunnel tests)
- Removed unused imports after daemon.go split