Repository navigation
add agent-compose run diagnostics and llm ls; fix token validation and slow ps - #88
Merged
Merged
Conversation
Track the latest published proto module. Of what this CLI uses, v0.1.12 adds LLMService.GetDefaultModel and completes the LLM provider API; the upgrade itself needs no code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make failed Runs debuggable from the CLI: - inspect run now shows error_stack, cleanup_error, warnings, labels, logs_path, artifacts_dir, and the scheduler/trigger/scheduler-run ids. Previously a failed Run showed only "agent execution failed". - run ls accepts relative times (30m, 24h, 7d) in --started-from and --started-to, truncated to milliseconds because the daemon rejects finer filters. - run ls gains --scheduler-run, a repeatable --label key=value, and --all-projects, which lists Runs across projects with a PROJECT column. - llm ls lists LLM providers, their models, the default model, and the latest protocol probes. Per-model headers are omitted because they may carry credentials. - --project gets the -p shorthand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auth login and auth status called HealthService to check the Token, but the daemon exempts HealthService from Bearer authentication so orchestrators can probe it. Any Token passed, and auth login saved a wrong one that failed only on the next real query. Validate with ListProjects (limit 1), which the daemon protects. The test stub now mirrors the daemon: HealthService accepts any Token while the project service checks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ps annotates each Sandbox with the Run that created it. For Sandboxes no Run owns, it read every Scheduler Run in the project, because the API cannot filter Scheduler Runs by Sandbox. On a project with ~31.5k Scheduler Runs that took ~130s even for ps --limit 20. Look up only the Sandboxes being listed, and stop early: - A scheduler creates Sandboxes for its own agent, so scan each agent's runs with the agent_name filter first. This skips high-volume agents that dominate the history. - ListSchedulerRuns returns newest first, so stop once every Sandbox is matched, or once runs started more than 24h before the oldest wanted Sandbox was created. - Sandboxes still unmatched fall back to the same bounded scan across all agents, so no association is lost if a scheduler ever creates a Sandbox for another agent. A Sandbox without a creation time disables the cutoff. On the project above, ps --all --limit 100 drops from 131.9s to 4.4s with identical Run associations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
eetoc
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
chaitin-cli agent-composeuseful for investigating failed Runs, fixauth login/auth statusaccepting any Token, and makepsusable on projects with a long Scheduler Run history (~130s → ~4s).All changes use APIs the daemon already exposes; no Agent Compose changes are needed.
Changes
Run diagnostics
inspect runnow showserror_stack,cleanup_error,warnings,labels,logs_path,artifacts_dir, andscheduler_id/trigger_id/scheduler_run_id. A failed Run used to show onlyagent execution failed;error_stackcarries the real cause (for example, a model stream disconnecting mid-response).run ls --started-from/--started-toaccept relative times (30m,24h,7d) as well as RFC3339. Values are truncated to milliseconds because the daemon rejects sub-millisecond filters.run lsflags:--scheduler-run <id>: Runs from one Scheduler Run.--label key=value: repeatable, ANDed.--all-projects: list across projects, with aPROJECTcolumn. The JSON output omitsproject. It cannot be combined with--project.New command
llm ls: LLM providers, their models, the default model, and the latest protocol probes (for exampleresponses=auth_failed). Per-modelheadersare deliberately omitted because they may carry credentials. It requires a daemon withLLMService; older daemons returnversion_incompatible.Flags
--projectgets the-pshorthand.Fix: Token validation
auth loginandauth statusvalidated the Token by callingHealthService. The daemon exempts that service from Bearer auth so orchestrators can probe it, so any Token passed, andauth loginsaved a wrong one that only failed on the next real query.ListProjects(limit 1), which the daemon protects.Fix:
psscanned every Scheduler Runpslabels each Sandbox with the Run that created it. For Sandboxes no Run owns, it read every Scheduler Run in the project, becauseListSchedulerRunscannot filter by Sandbox andSandboxdoes not record its origin. On a project with ~31.5k Scheduler Runs (~1.7k/day, 20-day retention), that meant ~316 sequential requests: ~130s even forps --limit 20.psnow looks up only the listed Sandboxes. It scans each agent's runs first (agent_namefilter), because a scheduler creates Sandboxes for its own agent. This skips high-volume polling agents, 88% of the history here.ListSchedulerRunsisstarted_at DESC, so the scan stops when either:created_atkeeps the old exhaustive scan.inspect scheduler-run,scheduler logs,scheduler stop).ResolveIDhas no Scheduler Run kind. The proper fix is daemon-side: a Scheduler Run kind inResolveID, and a Sandbox origin field or asandbox_idfilter onListSchedulerRuns.Dependency
github.com/chaitin/agent-compose/protov0.1.8 → v0.1.12. No code changes are needed for the upgrade itself.No
config.yaml, environment variable, or.envchanges.Examples
Commits
upgrade agent-compose proto to v0.1.12add agent-compose run diagnostics and llm lsvalidate agent-compose tokens against a protected rpcbound agent-compose ps scheduler run scansEach commit builds and passes tests on its own.
Test plan
task fmt:checktask linttask testNew tests:
ListRunsRequest--all-projectsskips project resolutioninspect runfieldsllm lsdefault-model marking and header omission-pis honoredauth statuseven thoughHealthServiceis exemptMutation-checked: removing the
error_stackmapping, or reverting token validation to an always-pass check, fails the new tests.Smoke-tested against a live daemon (
2609.4.5):status,project lsrun lswith--all-projects, relative times, and-pinspect runon a failed Runauth statuspsbounded scan: new tests inps_scan_test.go. The stub honorsagent_nameand counts requests. They cover:created_atis unknownEach stop condition, the per-agent scan, the fallback, and the unknown-time guard was mutation-checked.
ps --all --limit 100on a live project with ~31.5k Scheduler Runs (old vs new):llm lsagainst a daemon that implementsLLMService(the live daemon predates it and returnsversion_incompatible).🤖 Generated with Claude Code