Skip to content

feat: one-word status for every kind of agent work - #45

Open
hkfe wants to merge 1 commit into
mainfrom
feat/sharper-working-phase
Open

hkfe wants to merge 1 commit into
mainfrom
feat/sharper-working-phase

Conversation

@hkfe

@hkfe hkfe commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

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: OrchestrationV2WorkingPhase adds thinking, responding, running, installing, building, committing, pushing, delegating, waiting, planning.
  • packages/shared/src/orchestrationV2WorkingPhase.ts:
    • An unknown program no longer makes the command unknown. The highest phase across segments wins (running < waiting < reading < editing < installing < building < testing < measuring < committing < pushing).
    • Heredoc bodies are skipped. A read filter after a pipe (| head, | grep) does not count.
    • New command rules: file writes (>, mkdir, rm, cp, mv, tee), installs, build tasks, git and gh by subcommand, sleep and poll loops.
    • New tool rules: Agent, thread launch and send (delegating); background and thread waits, Monitor (waiting); Skill, ToolSearch, TodoWrite, plan tools (planning); PR tools (pushing); MCP read and write verbs.
    • reasoning items give Thinking and assistant_message items give Responding. A running run with no items yet is Thinking. Both item types join WORKING_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:changed passes (format, lint, knip, typecheck, tests, React compiler).
  • orchestrationV2WorkingPhase.test.ts: 66 cases, with new rows for each new rule and for Thinking and Responding in deriveWorkingPhase.
  • ProjectionStore.test.ts (52 pass): a thread-wait tool now shows waiting, not null.
  • Measured on the last 3000 real tool items (read-only export of the local database), before and after:
Phase Before After
none ("Working") 1627 0
reading 1124 1634
editing 119 380
testing 125 259
running n/a 152
committing n/a 122
pushing n/a 117
waiting n/a 88
planning n/a 83
building n/a 67
installing n/a 34
delegating n/a 32
measuring 5 32
  • GitHub Actions cannot run on this repo now (billing), so these local checks are the only checks.

Scope affected

Server shell projection (working phase), shared classifier, contracts and the web status label (sidebar, agent overview, switcher). The tui branch 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:

preview


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.

  • Adds statuses for thinking, responding, running, installing, building, committing, pushing, delegating, waiting, and planning.
  • Uses the latest turn item to set the status, so reasoning and responses can replace the status from an earlier tool call.
  • Classifies shell commands by their highest-priority action; unknown programs count as Running, and heredoc content and read-only pipe filters are ignored.
  • Adds matching labels, colors, and icons in the sidebar.

Written for commit fabc01a. Summary will update on new commits.

View guided diff Turn on auto-fix

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"]);

@cubic-dev-ai cubic-dev-ai Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
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"]);
Fix with cubic

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();

@cubic-dev-ai cubic-dev-ai Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with cubic

}
if (MEASURE.test(segment) && !READ_PROGRAMS.has(program)) return "measuring";
if (runner) return null;
if (program === "git") {

@cubic-dev-ai cubic-dev-ai Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with cubic

EDIT_PROGRAMS.has(program) ||
(program === "sed" && args.some((arg) => arg.startsWith("-i"))) ||
(program === "perl" && args.some((arg) => /^-\w*i/u.test(arg))) ||
writesFile(segment)

@cubic-dev-ai cubic-dev-ai Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant