Skip to content

improvement(cli): print what apply rewrote, drop the starter's duplicate primer, compact display findings - #10754

Merged
waleedlatif1 merged 5 commits into
stagingfrom
perf/cli-compact-agent-output
Dec 4, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
perf/cli-compact-agent-output

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • workflows source apply / create and workspaces source apply list the lines the reprint changed in the files they sent as rewrote (path -> zero-context hunks, at most 60 lines per command with a "reread " line past it, {} when nothing changed; .sim/ records excluded). Agents no longer need to reread workflow.ts after an apply. The primer and help now say so instead of "reread it before editing". The field is additive and no existing field changed
  • a create starter's JSON result names the guide (.sim/AGENTS.md) instead of embedding its primer, the same way get works. Coding agents read the guide anyway and Mothership holds the primer as a skill, so the primer was being read twice. --verbose keeps the field
  • help for a new workflow chains && cat ./new/.sim/AGENTS.md (cli surface only)
  • display-format findings print only a frame's marked line and caret, and print a hint once per code (3 same-code errors: 1383 -> 634 bytes on stderr)

Measurements (CLI with mock server)

  • create starter, JSON stdout: 5260 -> 590 bytes
  • apply with a 1-line reprint: +131 bytes for rewrote, which replaces a whole-file reread (3 KB here, 11-13 KB on the larger benchmark workflows); apply with no reprint: +17 bytes ("rewrote": {})

A/B (opus, code arm only, staging, 7 tasks x n=3, before = staging CLI, after = this branch)

  • correctness 21/21 in both arms
  • tokens -4% (882k vs 916k), cost -3%, tool output -4%, turns 11.5 vs 11.8. Within noise at n=3 (p=0.55); the per-output savings are deterministic
  • new-workflow tasks: the starter's tool result went 12.1 KB -> 7.5 KB, and agents read the primer once instead of twice (6/6 runs)

Type of Change

  • Improvement

Testing

  • workflow-source-apply / workspace-source-apply tests for rewrote, the dry run, the cap, .sim/ records, the starter primer and display findings. Each failed on the pre-change code
  • sim-cli protocol suite (764 tests), sim-cli tsc --noEmit, biome, check:cli-docs (regenerated)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…mer, compact display findings

- workflows/workspaces source apply and create list the lines the reprint changed in the files
  they sent as `rewrote` (path -> context-free hunks, capped at 60 lines; {} when nothing
  changed), so an agent edits on without rereading workflow.ts; primer and help say so
- a create starter's JSON result names the guide instead of embedding its primer (agents read
  .sim/AGENTS.md anyway, Mothership holds the primer as a skill); --verbose keeps it
- display findings print only a frame's marked lines, and a hint once per code
…, color display diffs; primer policy in printTreeResult
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 4, 2026 1:06am UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Greptile is unavailable right now, so this PR is gated on green CI, a cubic review of the HEAD commit, and zero unresolved threads.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 6444a91 into staging Dec 4, 2026
69 of 83 checks passed
@waleedlatif1
waleedlatif1 deleted the perf/cli-compact-agent-output branch December 4, 2026 01:21

This branch was previously deployed

1 inactive deployment
Preview — c0ecf5b2 Deployed Dec 4, 2026 by vercel[bot]
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