Skip to content

Redesign CLI output around one shared terminal layer - #12

Open
lydakis wants to merge 10 commits into
mainfrom
claude/project-thread-uvkmhl
Open

lydakis wants to merge 10 commits into
mainfrom
claude/project-thread-uvkmhl

Conversation

@lydakis

@lydakis lydakis commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Requested by George

CLI commands previously used separate output formats. This change gives run headers and results, lists, status, help, errors, and daemon lifecycle logs one shared terminal layer. Interactive output uses aligned tables, styled states, spinners, and progress bars; piped output uses stable plain text. Quiet, verbose, and JSON modes follow consistent rules.

The views include short job IDs, queue position, changed-path counts, and workspace-removal receipts. Backend changes provide those fields and deliver lifecycle events without blocking jobs. Presentation review fixes cover cancellation, output-write failures, safe command hints, stream coordination, and upload progress accounting. Hidden progress avoids tar sizing and callback overhead; visible progress redraws are throttled.

The independent single-version protocol cleanup is in #20 and is excluded from this PR's additional review-fix commit. CLI and daemon versions must match.

Validation:

  • Targeted presentation, terminal, quiet-mode, workspace-removal, and client-view tests pass with the race detector.
  • go vet ./... and the CLI build pass.
  • The full race suite has the same 20 known environment-related failures as the earlier reviewed snapshot, with no new failures or race reports.

Every command now prints through internal/termui: one header and one
result line per run, glyph status lines, aligned tables, spinners and
progress that clear themselves, human units, and short job handles.
Piped output drops styling and keeps stable, prefixed lines; -q, -v and
--json behave the same everywhere. Help uses one format, and errors read
as an error line plus a hint with the fix.

Runners gain what the new views need: job lookup by id prefix, queue
position in job status, changed-path counts in job lists, per-job log
events for errand serve, and freed bytes when removing a workspace.
@lydakis lydakis self-assigned this Sep 26, 2026
@lydakis
lydakis marked this pull request as ready for review September 26, 2026 03:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T06:31:23.075158Z e1d86dc New commits
🔒 Security Review ✅ Completed 2026-09-26T03:11:09.711154Z 1176440 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1176440afc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/errand/df_render.go
Comment thread cmd/errand/df_render.go
Comment thread internal/client/run_view.go Outdated
Comment thread internal/client/run_view.go Outdated
Comment thread cmd/errand/jobs.go Outdated
Comment thread cmd/errand/fetch.go
Comment thread cmd/errand/push.go Outdated
Comment thread cmd/errand/ui.go Outdated
The client reports a queue only after the job has waited 400ms, so a
fixed 350ms sleep before freeing the slot raced on fast Linux runners.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2833593fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/client/workspaces.go
Comment thread cmd/errand/status.go Outdated
Comment thread cmd/errand/workspaces.go Outdated
Comment thread internal/client/run_view.go
Comment thread cmd/errand/status.go Outdated
Comment thread cmd/errand/setup.go Outdated
Comment thread internal/daemon/workspaces_http.go Outdated
Comment thread internal/client/run_view.go
Quote runner- and checkout-supplied text (changed paths, start and
transaction errors, apply errors) before it reaches a terminal. Keep -q
printing the value scripts need on a terminal (fetch path, push id, new
workspace name) and start failures. Keep df's piped and --json rows in
configured runner order. Size upload progress by the tar stream it
counts. Recheck a queued job before drawing a delayed queue line. Say
when kill can't confirm a stop instead of calling the job running. Use
--url in hints for raw runner addresses, put peers add options before
its operands with the socket included, keep the start error on
ambiguous jobs, and measure a removed workspace outside the store lock.

Also update a test that main added for the new RemoveWorkspace return.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2faa30478e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/client/run_view.go
Comment thread internal/client/client.go Outdated
Comment thread cmd/errand/fetch.go Outdated
Comment thread cmd/errand/doctor.go Outdated
Comment thread cmd/errand/doctor.go Outdated
Comment thread cmd/errand/serve.go Outdated
Comment thread cmd/errand/fetch.go Outdated
Serialize run-view updates, which arrive from the upload packer, the
interrupt controller, and the queue watcher at once. Quote checkout-
derived project, directory, and binding labels in the run header. Give
fetch --json the same object shape when nothing changed, and keep the
selected path in the conflict retry hint. Start doctor's spinner only
after the arguments check out, and report configured runners it cannot
resolve. Log a queued job killed before it started as exactly that.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7334b8924d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/client/run_view.go
Comment thread cmd/errand/doctor.go
Comment thread cmd/errand/placement.go Outdated
Comment thread cmd/errand/doctor.go
Comment thread cmd/errand/fetch.go Outdated
Comment thread internal/daemon/job.go
Comment thread cmd/errand/ui.go
Comment thread cmd/errand/status.go Outdated
Comment thread cmd/errand/serve.go Outdated
Comment thread internal/daemon/job.go
Deliver serve's job log lines from their own goroutine, so a stalled log
consumer can't delay a job's start, runtime limit, or result. Route job
output through the run console so it and the queue line never write the
same stream at once. Quote runner text in every described error, doctor
checks, and placement notes, and control characters in serve's
key=value fields. Treat every ambiguous job as unconfirmed, even with an
exit code. Keep doctor's errors under -q, and report a failed write of
fetch's unchanged JSON.
The log hook used a fixed buffer that dropped events when a consumer
stalled, contradicting its one-event-per-moment contract, and Close could
leave queued events undelivered. Events now wait in an ordered, unbounded
queue on the delivery goroutine, and Close drains it, waiting at most two
seconds on a stalled consumer.
@lydakis

lydakis commented Sep 26, 2026

Copy link
Copy Markdown
Owner Author

The red github-advanced-security check ("Code scanning AI findings") isn't caused by this PR. GitHub's Copilot autofind job fails before it reads any code, with CAPIError: 400 The requested model is not supported. It has failed the same way on every push here (1176440, f283359, 2faa304, 7334b89, 1c64c8c, 6b6f37a), and on #6 since 02:23 UTC. The last success was #11 at 02:01 UTC.

There's no code fix to port. The model used by Copilot code scanning needs changing in the repo's code-scanning settings, or GitHub needs to restore support for it. A re-run would hit the same error, so I haven't queued one. The checks that test the code (Check on ubuntu-24.04 and macos-15, CodeQL, GitGuardian) are the ones to watch.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b6f37a113

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/errand/access.go
Comment thread cmd/errand/fetch.go Outdated
Comment thread cmd/errand/push.go Outdated
Comment thread internal/daemon/server.go Outdated
Comment thread internal/termui/termui.go Outdated
Record a job's queued log event while the store lock still keeps it from
starting, so the log never shows started before queued. Shell-quote the
paths and arguments in suggested push and fetch commands. Give only
terminal streams a truncation width, so redirected output keeps full
columns. Keep access edits silent under -q.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1d86dc512

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/daemon/workspaces_http.go
Comment thread cmd/errand/version.go Outdated
Comment thread cmd/errand/workspaces.go Outdated
Comment thread cmd/errand/serve.go Outdated
Comment thread cmd/errand/doctor.go
Quote runner versions in errand version -v. Make workspaces -q print one
peer/name per line and nothing when empty. Log an ambiguous job, or one
whose transaction failed after exit 0, as unconfirmed rather than a
success. Keep doctor's local automatic-apply checks on every exit path,
including a failed --where placement or SSH check.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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