10 KiB
@aoagents/ao-plugin-agent-claude-code
0.9.1
Patch Changes
- 2d4c457: Fix canary nightly to include all publishable packages and fix Next.js import.meta.url build path issue
- Updated dependencies [
2d4c457]- @aoagents/ao-core@0.9.1
0.9.0
Minor Changes
-
7d9b862: Replace Claude Code terminal-regex activity detection with platform-event hooks (#1941).
Claude Code emits a lifecycle hook on every state transition that matters
(PermissionRequest,StopFailure,Notification,Stop,PreToolUse,
…). Until now, AO ignored all but one of them and tried to infer the
same information by regex-matching Claude's rendered terminal output —
fragile by construction. Every Claude UI tweak (footer wording, status
verb, spinner glyph) broke a heuristic; PR #1932 spent 15 commits
patching the sharpest edges.This release pivots:
@aoagents/ao-plugin-agent-claude-codenow installs two scripts per
workspace:metadata-updater— unchanged; PostToolUse(Bash) extracts gh/git
side-effects (PR URL, branch, merge status).activity-updater— new; registered on every hook that carries
activity information (SessionStart, UserPromptSubmit, PreToolUse,
PostToolUse, PostToolUseFailure, PostToolBatch, Notification,
PermissionRequest, Stop, StopFailure, SubagentStart, SubagentStop,
PreCompact, PostCompact). The script reads the JSON payload from
stdin, mapshook_event_nameto an activity state, and appends a
JSONL entry to{workspace}/.ao/activity.jsonlwithsource: "hook".
Notification is filtered by
notification_typesoauth_success/
elicitation_*no longer false-firewaiting_input(the RFC's blanket
"Notification → waiting_input" would have regressed here).The terminal-regex layer (
classifyTerminalOutput, ~80 LOC of
patterns +agent.recordActivity) is retired.detectActivitystays on
the Agent interface for other agents but is now a stablereturn "idle"
stub for Claude — the JSONL-backed cascade is the only source of truth
for active / ready / waiting_input / blocked.@aoagents/ao-coreextendsActivityLogEntry.sourceand
ActivitySignalSourcewith a"hook"value so the new entries are
parseable and their provenance is visible in telemetry. No downstream
consumer needs changes — the cascade has always read whatever source
appeared in the JSONL, and the new tests assert hook-sourced entries
flow throughcheckActivityLogState/getActivityFallbackState
identically to terminal-sourced ones.Idempotent install: calling
setupWorkspaceHookstwice keeps exactly
one entry per event and preserves user-installed hooks alongside ours.
Cross-platform: bash + Node (.cjs) variants behave identically against a
shared 52-case scenario table.
Patch Changes
-
a610601: Split Claude Code activity-detection logic out of
index.tsinto a dedicatedactivity-detection.tsmodule. Removes two unreachable switch branches (case "permission_request"→waiting_inputandcase "error"→blocked) that targeted JSONL types Claude never actually emits.waiting_inputcontinues to flow through the AO activity-JSONL safety net added in #1903.Closes the
blockedgap for Claude Code: extendreadLastJsonlEntryin core to also surface top-levelsubtypeandlevelfields, and map{type:"system", level:"error"}→blockedin the cascade. This catches Claude's real api_error shape ({type:"system", subtype:"api_error", level:"error", cause:{code:"ConnectionRefused"|"FailedToOpenSocket"|...}}) so a session stuck in the API retry loop now reportsblockedinstead ofready. New fields onreadLastJsonlEntryare additive and don't break existing callers (Codex, OpenCode, Aider). -
8c71bde: Harden Claude Code activity detection against five real-world edge cases identified during PR #1927's analysis:
- Bookkeeping types → false-active.
file-history-snapshot,attachment,pr-link,queue-operation,permission-mode,last-prompt,ai-title,agent-color,agent-name,custom-titlewere falling through to thedefaultswitch branch and showing asactivefor 30s after Claude finished a turn. They now correctly map toready/idleby age. Likely root cause of "Claude looks busy when it's done" reports. - Multi-session disambiguation.
findLatestSessionFilepicked newest-mtime, which is the wrong session's JSONL when two Claude sessions are running in the same workspace. Now prefers the UUID-named file (<projectDir>/<claudeSessionUuid>.jsonl) whensession.metadata.claudeSessionUuidis set, falling back to newest-mtime otherwise. - Symlinked workspaces.
toClaudeProjectPathwas a pure string transform — symlink paths produced different slugs than what Claude itself wrote. AddedresolveWorkspaceForClaude(path)that runsrealpathSync(with fallback) and used it in all three slug-computing sites (getClaudeActivityState,getSessionInfo,getRestoreCommand). - Process regex too narrow.
(?:^|\/)claude(?:\s|$)was missing several legitimate install variants —.claude,claude-code,claude.exe,claude.js, and npm shims likenode /opt/.../@anthropic-ai/claude-code/cli.js. Broadened to(?:^|\/)(?:\.)?claude(?:[-.][\w-]+)*(?:[\s/]|$); still rejects look-alikes (claudia,claudine). - Silent permission-denied.
findLatestSessionFilewas swallowing everyreaddirerror silently — a missing~/.claude/projects/<slug>/(ENOENT) is normal, but a permission-denied (EACCES/EPERM) or fd-exhausted (EMFILE) misconfig left the session looking permanentlyidleon the dashboard with zero telemetry. Now logs a singleconsole.warnfor non-ENOENT errors.
193/193 plugin tests pass. No public-API change. New helper
resolveWorkspaceForClaudeis re-exported fromindex.tsfor downstream consumers. - Bookkeeping types → false-active.
-
Updated dependencies [
73bed33] -
Updated dependencies [
a610601] -
Updated dependencies [
7d9b862] -
Updated dependencies [
6d48022] -
Updated dependencies [
fcedb25] -
Updated dependencies [
94981dc] -
Updated dependencies [
2980570] -
Updated dependencies [
d5d0f07]- @aoagents/ao-core@0.9.0
0.8.0
Minor Changes
- Distinguish indeterminate agent process probes from definitive process-missing results, and raise ps probe timeouts to avoid bulk runtime_lost terminations when ps or tmux cannot return a reliable verdict.
Patch Changes
- Updated dependencies
- @aoagents/ao-core@0.8.0
0.7.0
Minor Changes
-
0f5ae0b: feat: native Windows support
AO now runs natively on Windows. The default runtime on Windows is
process
(ConPTY vianode-pty+ named pipes — no tmux, no WSL); the dashboard,
agents (claude-code, codex, kimicode, aider, opencode, cursor),ao doctor,
andao updateall work out of the box. Each session gets a small detached
pty-host helper that wraps a ConPTY behind\\.\pipe\ao-pty-<sessionId>,
registered soao stopcan reach it.A new cross-platform abstraction layer (
packages/core/src/platform.ts)
centralises every platform branch behind helpers likeisWindows(),
getDefaultRuntime(),getShell(),killProcessTree(),findPidByPort(),
andgetEnvDefaults(). Path comparison usespathsEqual/
canonicalCompareKeyto handle NTFS case-insensitivity. PATH wrappers for
agent plugins (gh,git) ship as.cjs+.cmdshims on Windows;
script-runnerruns.ps1siblings of.shscripts via PowerShell. New
ao-doctor.ps1/ao-update.ps1shipped.ao openis now cross-platform: it sources sessions fromsm.list()
instead oftmux list-sessions(soruntime-processsessions on Windows
appear), and the open action branches per OS —open-iterm-tabstays the
macOS path, native handling on Windows and Linux.Behaviour on macOS and Linux is unchanged. Every Windows path is gated
behindisWindows();runtime-tmuxand the bash hook flows are untouched.See
docs/CROSS_PLATFORM.mdfor the developer reference (helper inventory,
EPERM-vs-ESRCH gotcha, PowerShell-vs-bash differences, pre-merge checklist).
The Windows runtime architecture (pty-host, pipe protocol, registry, sweep,
mux WS Windows branch) is documented indocs/ARCHITECTURE.md.
Patch Changes
- Updated dependencies [
0f5ae0b] - Updated dependencies [
fe33bb7] - Updated dependencies [
7c46dc9]- @aoagents/ao-core@0.7.0
0.6.0
Patch Changes
- Updated dependencies
- Updated dependencies [
40aeb78] - Updated dependencies
- Updated dependencies
- @aoagents/ao-core@0.6.0
0.5.0
Patch Changes
- Updated dependencies [
dd07b6b]- @aoagents/ao-core@0.5.0
0.4.0
Patch Changes
- b0d0994: Improve Claude Code and Codex session cost estimates to account for cached-token spend, make Codex restore commands fall back to approval prompts for worker sessions instead of blindly reusing dangerous bypass flags, and register the Codex plugin in the web dashboard so native activity detection works there.
- e465a47: Fix
toClaudeProjectPathto fold underscores (and any other non-alphanumeric character) to dashes, matching Claude Code's actual on-disk slug encoding. Previously only/,., and:were normalized, so AO project data dirs of the form<sanitized>_<hash>produced slugs that pointed to non-existent directories —getSessionInfoandgetRestoreCommandcould never locate the session JSONL,claudeSessionUuidnever got persisted, and restoring orchestrator/worker sessions in any multi-project setup failed with a 409 "getRestoreCommand returned null". Fixes #1611. - Updated dependencies [
2306078] - Updated dependencies [
faaddb1] - Updated dependencies [
f330a1e] - Updated dependencies [
a862327] - Updated dependencies [
331f1ce] - Updated dependencies [
703d584] - Updated dependencies [
f674422] - Updated dependencies [
62353eb] - Updated dependencies [
bd36c7b] - Updated dependencies [
e7ad928] - Updated dependencies [
ca8c4cc] - Updated dependencies [
7b82374] - Updated dependencies [
4701122] - Updated dependencies [
c8af50f] - Updated dependencies [
bcdda4b] - Updated dependencies [
1cbf657] - Updated dependencies [
c447c7c] - Updated dependencies [
a45eb32] - Updated dependencies [
7072143] - Updated dependencies [
ed2dcea]- @aoagents/ao-core@0.4.0
0.2.0
Patch Changes
- 3a650b0: Zero-friction onboarding:
ao startauto-detects project, generates config, and launches dashboard — no prompts, no manual setup. Renamed npm package to@composio/ao. Made@composio/ao-webpublishable with production entry point. Cross-platform agent detection. Auto-port-finding. Permission auto-retry in shell scripts. - Updated dependencies [
3a650b0]- @composio/ao-core@0.2.0