Repository navigation
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>
Contributor
Author
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
agent-compose pswas taking ~130s on a busy project, even with--limit 20. It now takes ~4s, and the Run associations are identical.Root cause
pslabels each Sandbox with the Run that created it. When a listed Sandbox has no owning Run, it fetched every Scheduler Run in the project to find the one that created the Sandbox. The API gives no other way to do this:ListSchedulerRunscannot filter by Sandbox, andSandboxdoes not record its origin.On a project with ~31.5k Scheduler Runs (~1.7k/day, 20-day retention), that is ~316 sequential requests. Each individual RPC is fast (0.1–0.5s).
Changes
Only the
psassociation path changes.listSchedulerRunsand the other commands are untouched.Look up only the listed Sandboxes. The lookup now covers just the Sandboxes being listed that no Run owns, instead of the project's whole history.
Scan per agent first. A scheduler creates Sandboxes for its own agent, so each agent's Sandboxes are looked up with the
agent_namefilter. This skips high-volume polling agents, which made up 88% of the history here.Stop early.
ListSchedulerRunsreturns newest first (started_at DESCin the daemon store). The scan stops when either:The 24h margin covers a Scheduler Run that creates its Sandbox long after it starts, since common
SCHEDULER_RUN_TIMEOUTvalues are a few hours.Fallback. Sandboxes still unmatched get the same bounded scan across all agents, so no association is lost if a scheduler ever creates a Sandbox for another agent.
Unknown creation time. A Sandbox without
created_atdisables the cutoff and keeps the old exhaustive behavior.No flags, config, environment variable, or
.envchanges.Known limitation
Resolving a Scheduler Run from a short ID prefix still reads the full history. This affects
inspect scheduler-run,scheduler logs, andscheduler stop, as well as an untypedinspect <ref>that does not match an earlier kind.ResolveIDhas no Scheduler Run resource kind, so the CLI cannot do better. The proper fix is daemon-side: add a Scheduler Run kind toResolveID, and a Sandbox origin field or asandbox_idfilter onListSchedulerRuns. With those,pswould need no scan at all.Test plan
task fmt:check,task lint,task testps_scan_test.go. The stub honorsagent_nameand counts requests. They cover:created_atis unknownps --all --limit 100(old vs new):🤖 Generated with Claude Code