Skip to content

fix(cli): keep the spinner on one row, and warn before the cost cap cuts the review off - #7

Merged
noobnooc merged 3 commits into
mainfrom
fix/spinner-wrap-and-cost-warning
Sep 15, 2026
Merged

noobnooc merged 3 commits into
mainfrom
fix/spinner-wrap-and-cost-warning

Conversation

@noobnooc

Copy link
Copy Markdown
Collaborator

Summary

Two problems seen running gribble audit on a ~55-column terminal with budget.max_cost_usd: 3 set.

Progress line repeats instead of updating. @clack/prompts' spinner (1.8.0, still present in 1.8.1) computes how many rows to erase from the bare message, but renders ◐ + message + up to three dots. A message that only fits without that chrome wraps whenever the dot count reaches 2–3 — about 1.3 s of every 2.56 s cycle — and each of those frames leaves a stale row behind. The reviewing (55/200 steps · 1.2M/2.0M tokens · $3.25) line is 51 characters, which is exactly that case at 55 columns.

Fix: fitSpinnerMessage in prompts.ts truncates spinner messages to output.columns minus 7 (frame, spaces, dots, one column of margin) and appends …. Applies to every spinner from clackPrompter. Driving clack with a 55-column fake stream: 17 of 34 frames wrapped before, 0 after.

Cost cap ends the review with no warning. The 75% budget notice that asks the model to close the flow and call finalize_report only looked at steps and tokens. A run that hit the dollar cap first (55/200 steps, 1.2M/2.0M tokens, $3.25/$3) was aborted mid-flow without the model ever being told to wrap up. The cost ratio now feeds the same notice, and the notice text includes $x.xx/$cap when a cap is set.

Neither change affects exit codes: the run in question exited 1 because the gate found 2 new error findings, which is the intended behaviour.

Checklist

  • pnpm lint && pnpm typecheck && pnpm test pass
  • Added a changeset (pnpm changeset) if a published package changed
  • Docs updated (docs/) if behavior changed — no documented behaviour changed; the notice and spinner are not described in docs/

🤖 Generated with Claude Code

noobnooc and others added 2 commits September 15, 2026 22:41
…uts the review off

Two problems seen on a narrow terminal with budget.max_cost_usd set:

- clack's spinner counts rows to erase from the bare message but renders
  it with a frame glyph and up to three dots, so a message that fits only
  without them wraps every few frames and leaves a stale row behind each
  tick. Truncate spinner messages to the terminal width minus that chrome.

- The 75% budget notice only considered steps and tokens, so a run that
  hit the dollar cap first was aborted mid-flow without the model ever
  being asked to finalize. Include the cost ratio in the notice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gribble-website a2e7c12 Commit Preview URL

Branch Preview URL
Sep 15 2026, 02:50 PM

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🐛 Gribble (apps/website): gate passed

The gribbles went hungry. Ship it.

new existing fixed critical error warn info
0 0 5 0 0 0 0

Full report

Gribble 0.2.1 · mode gate · http://localhost:4173

✅ Step passed: No new findings at or above error. (fail-on: error)

Check run with annotations

…e after the upstream rework

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@noobnooc
noobnooc merged commit 2eec087 into main Sep 15, 2026
7 checks passed
@noobnooc
noobnooc deleted the fix/spinner-wrap-and-cost-warning branch September 15, 2026 14:52
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