Repository navigation
Conversation
The status fell back to Working for 56% of recent tool calls, because one unknown program made a whole command unknown. Unknown programs now count as Running, and new words cover thinking, responding, installing, building, committing, pushing, delegating, waiting and planning.
There was a problem hiding this comment.
4 issues found across 6 files
You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/shared/src/orchestrationV2WorkingPhase.ts">
<violation number="1" location="packages/shared/src/orchestrationV2WorkingPhase.ts:156">
P2: `git pull` updates the checkout but this set classifies it as Reading. Remove `pull` from the read-only set so it falls through to Running.</violation>
<violation number="2" location="packages/shared/src/orchestrationV2WorkingPhase.ts:284">
P2: `env` is stripped after this assignment loop, so `env FOO=1 npm test` treats `FOO=1` as the executable and reports Running. Strip assignment tokens after wrapper prefixes too.</violation>
<violation number="3" location="packages/shared/src/orchestrationV2WorkingPhase.ts:302">
P2: `MEASURE` runs before the new git/gh dispatch, so `git push origin bench-results` is labeled `measuring` because the branch matches `bench`. Classify known git/gh subcommands first.</violation>
<violation number="4" location="packages/shared/src/orchestrationV2WorkingPhase.ts:322">
P2: `echo` and `printf` return `neutral` before this check, so `printf ... > output.txt` falls through to `running` instead of `editing`. Detect file redirection before the neutral early return.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| const NEUTRAL_PROGRAMS = new Set(["cd", "echo", "true", "export", "set", "sleep", "printf"]); | ||
| const PREFIX_PROGRAMS = new Set(["time", "env", "nice", "npx", "bunx", "uvx", "exec"]); | ||
| const PACKAGE_MANAGERS = new Set(["brew", "pip", "pip3", "uv", "gem", "apt", "apt-get"]); | ||
| const GIT_READ = new Set(["log", "show", "diff", "status", "blame", "grep", "fetch", "pull"]); |
There was a problem hiding this comment.
P2: git pull updates the checkout but this set classifies it as Reading. Remove pull from the read-only set so it falls through to Running.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/shared/src/orchestrationV2WorkingPhase.ts, line 156:
<comment>`git pull` updates the checkout but this set classifies it as Reading. Remove `pull` from the read-only set so it falls through to Running.</comment>
<file context>
@@ -92,9 +152,52 @@ const TASK_RUNNERS = new Set([
-const NEUTRAL_PROGRAMS = new Set(["cd", "echo", "true", "export", "set", "sleep", "printf"]);
-const PREFIX_PROGRAMS = new Set(["time", "env", "nice", "npx", "bunx", "uvx", "exec"]);
+const PACKAGE_MANAGERS = new Set(["brew", "pip", "pip3", "uv", "gem", "apt", "apt-get"]);
+const GIT_READ = new Set(["log", "show", "diff", "status", "blame", "grep", "fetch", "pull"]);
+const GIT_COMMIT = new Set([
+ "add",
</file context>
| const GIT_READ = new Set(["log", "show", "diff", "status", "blame", "grep", "fetch", "pull"]); | |
| const GIT_READ = new Set(["log", "show", "diff", "status", "blame", "grep", "fetch"]); |
| function classifySegment(segment: string): Phase | "neutral" { | ||
| const tokens = segment.split(/\s+/u).filter((token) => token.length > 0); | ||
| while (tokens.length > 0 && KEYWORD_PREFIXES.has(tokens[0]!)) tokens.shift(); | ||
| while (tokens.length > 0 && /^\w+=/u.test(tokens[0]!)) tokens.shift(); |
There was a problem hiding this comment.
P2: env is stripped after this assignment loop, so env FOO=1 npm test treats FOO=1 as the executable and reports Running. Strip assignment tokens after wrapper prefixes too.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/shared/src/orchestrationV2WorkingPhase.ts, line 284:
<comment>`env` is stripped after this assignment loop, so `env FOO=1 npm test` treats `FOO=1` as the executable and reports Running. Strip assignment tokens after wrapper prefixes too.</comment>
<file context>
@@ -141,86 +256,122 @@ function commandSegments(command: string): string[] {
+function classifySegment(segment: string): Phase | "neutral" {
+ const tokens = segment.split(/\s+/u).filter((token) => token.length > 0);
+ while (tokens.length > 0 && KEYWORD_PREFIXES.has(tokens[0]!)) tokens.shift();
+ while (tokens.length > 0 && /^\w+=/u.test(tokens[0]!)) tokens.shift();
while (tokens.length > 0 && PREFIX_PROGRAMS.has(tokens[0]!)) tokens.shift();
if (tokens[0] === "timeout") tokens.splice(0, 2);
</file context>
| } | ||
| if (MEASURE.test(segment) && !READ_PROGRAMS.has(program)) return "measuring"; | ||
| if (runner) return null; | ||
| if (program === "git") { |
There was a problem hiding this comment.
P2: MEASURE runs before the new git/gh dispatch, so git push origin bench-results is labeled measuring because the branch matches bench. Classify known git/gh subcommands first.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/shared/src/orchestrationV2WorkingPhase.ts, line 302:
<comment>`MEASURE` runs before the new git/gh dispatch, so `git push origin bench-results` is labeled `measuring` because the branch matches `bench`. Classify known git/gh subcommands first.</comment>
<file context>
@@ -141,86 +256,122 @@ function commandSegments(command: string): string[] {
+ }
if (MEASURE.test(segment) && !READ_PROGRAMS.has(program)) return "measuring";
- if (runner) return null;
+ if (program === "git") {
+ const sub =
+ args.filter(
</file context>
| EDIT_PROGRAMS.has(program) || | ||
| (program === "sed" && args.some((arg) => arg.startsWith("-i"))) || | ||
| (program === "perl" && args.some((arg) => /^-\w*i/u.test(arg))) || | ||
| writesFile(segment) |
There was a problem hiding this comment.
P2: echo and printf return neutral before this check, so printf ... > output.txt falls through to running instead of editing. Detect file redirection before the neutral early return.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/shared/src/orchestrationV2WorkingPhase.ts, line 322:
<comment>`echo` and `printf` return `neutral` before this check, so `printf ... > output.txt` falls through to `running` instead of `editing`. Detect file redirection before the neutral early return.</comment>
<file context>
@@ -141,86 +256,122 @@ function commandSegments(command: string): string[] {
+ EDIT_PROGRAMS.has(program) ||
+ (program === "sed" && args.some((arg) => arg.startsWith("-i"))) ||
+ (program === "perl" && args.some((arg) => /^-\w*i/u.test(arg))) ||
+ writesFile(segment)
) {
return "editing";
</file context>
Summary
The running status fell back to "Working" for 56% of recent tool calls, because one unknown program in a command made the whole command unknown. Now every running thread gets a one-word action: unknown commands count as Running, and new words cover the work that had no word.
Changes
packages/contracts/src/orchestrationV2.ts:OrchestrationV2WorkingPhaseaddsthinking,responding,running,installing,building,committing,pushing,delegating,waiting,planning.packages/shared/src/orchestrationV2WorkingPhase.ts:| head,| grep) does not count.>,mkdir,rm,cp,mv,tee), installs, build tasks, git and gh by subcommand,sleepand poll loops.reasoningitems give Thinking andassistant_messageitems give Responding. A running run with no items yet is Thinking. Both item types joinWORKING_PHASE_TURN_ITEM_TYPES, so the SQL shell read picks them up too.apps/web/src/components/Sidebar.logic.ts: labels and colors for the new phases.apps/web/src/components/sidebar/SidebarThreadRow.tsx: lucide icons for the new phases.Tests
vp run check:changedpasses (format, lint, knip, typecheck, tests, React compiler).orchestrationV2WorkingPhase.test.ts: 66 cases, with new rows for each new rule and for Thinking and Responding inderiveWorkingPhase.ProjectionStore.test.ts(52 pass): a thread-wait tool now showswaiting, not null.Scope affected
Server shell projection (working phase), shared classifier, contracts and the web status label (sidebar, agent overview, switcher). The
tuibranch decodes the same schema, so it must merge main after this. No change to thread status or wait counts.Reasoning
Thinking and Responding make the status follow the latest item, not only the latest tool, so a thread that reasons after a read no longer shows Reading. The payload read adds at most one row per running thread.
Preview
The new words with their icons and colors, rendered with the app styles in a headless browser:
Summary by cubic
Running threads now show a one-word activity instead of falling back to “Working” for unrecognized commands or work. This makes the status more useful for seeing what the agent is doing.
Written for commit fabc01a. Summary will update on new commits.