Skip to content

fix(cli): show real cause past the elision marker in deployments-list snippet - #341

Merged
khaliqgant merged 1 commit into
mainfrom
fix/cli-error-snippet-elision-tail
Sep 17, 2026
Merged

khaliqgant merged 1 commit into
mainfrom
fix/cli-error-snippet-elision-tail

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Follow-up to cloud#3649 (merged), which fixed the backend to store unrecognized long deployment-run failures as <head>...[N chars omitted]...<tail> — keeping both ends so the real cause survives the 10,000-char storage truncation instead of being lost behind the unconditional mount/smithy bootstrap boilerplate that runs before every persona invocation.
  • But agentworkforce deployments list's compact table still showed a raw [smithy-diag] dump for these agents even after that backend fix landed. Root cause: formatDeploymentErrorSnippet in packages/cli/src/list-command.ts slices the stored error from position 0 down to 240 chars for the table view — well inside the boilerplate head, before ever reaching the elision marker.
  • Confirmed live against a workspace with the cloud fix already deployed: deployments list --json shows the full stored error for chief-watchdog/hn-monitor already contains the marker and real tail content, but the compact table still only showed the head.

Fix

  • When formatDeploymentErrorSnippet finds the ...[N chars omitted]... marker in a too-long error, it now snippets from just after the marker (the preserved real-cause tail) instead of from the start.
  • Falls back to the original head-truncation behavior when the marker isn't present (short errors, or errors from a recognized failure class where the real cause is already hoisted to the front) — zero behavior change for those cases.

Test plan

  • list-command.test.ts: existing tests unchanged/passing + 1 new test proving the snippet shows the real cause past the marker instead of [smithy-diag] boilerplate
  • packages/cli full build + typecheck clean
  • 32 pre-existing failures in unrelated runInvoke/isolated-worker sandbox tests confirmed unrelated (environment-only, not touching list-command.ts)

Note

Low Risk
CLI-only display logic for deployment error snippets; no API, auth, or persistence changes.

Overview
Fixes agentworkforce deployments list so compact table Errors lines show the preserved failure tail instead of repeated mount/smithy boilerplate.

Cloud already stores very long unrecognized run failures as &lt;head&gt;...[N chars omitted]...&lt;tail&gt;, but formatDeploymentErrorSnippet still truncated from character 0 (240 chars), which never reached the marker. It now detects ...[digits chars omitted]... and snippets from just after that marker, with the same head truncation when the marker is missing.

Adds a unit test that asserts the table shows the real cause and omits smithy-diag boilerplate.

Reviewed by Cursor Bugbot for commit 5cd83bf. Bugbot is set up for automated code reviews on this repo. Configure here.

Review in cubic

…not the boilerplate head

cloud#3649 fixed the backend to keep both the head and tail of a long,
unrecognized deployment-run failure (stored as
<head>...[N chars omitted]...<tail>), so the real cause survives its
own 10_000-char truncation instead of being lost behind the
unconditional mount/smithy bootstrap boilerplate.

But formatDeploymentErrorSnippet in `deployments list`'s compact table
still sliced from position 0 down to 240 chars - well inside the
boilerplate head, before ever reaching the elision marker. Every
unrecognized failure kept showing an opaque [smithy-diag] dump in the
table view even after the backend fix landed (confirmed live: the
stored `error` for chief-watchdog/hn-monitor already contains the
elision marker and the real tail content via --json, but the compact
table still showed only the head).

Fix: when the marker is present, snippet from just after it instead of
from the start.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e86d7d95-a0cf-4c51-8261-9b2c6536e570

📥 Commits

Reviewing files that changed from the base of the PR and between f18da55 and 5cd83bf.

📒 Files selected for processing (2)
  • packages/cli/src/list-command.test.ts
  • packages/cli/src/list-command.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The CLI now detects cloud-elided deployment errors and formats the text after the omission marker. A test verifies that the real cause appears without the repeated boilerplate.

Changes

Deployment Error Snippets

Layer / File(s) Summary
Omitted marker detection and snippet selection
packages/cli/src/list-command.ts
formatDeploymentErrorSnippet detects ...[N chars omitted]... and formats the remaining error text. It retains leading truncation when no usable marker exists.
Formatter regression test
packages/cli/src/list-command.test.ts
The test verifies that the formatted output includes the real cause and excludes the smithy-diag boilerplate.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5cd83

This localized CLI formatting change exposes real causes from cloud-elided errors while retaining the prior fallback behavior, with no material merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: showing the real deployment error cause after the elision marker in the CLI list output.
Description check ✅ Passed The description directly explains the existing truncation issue, the elision-marker fix, preserved fallback behavior, and test coverage. It is fully related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-error-snippet-elision-tail

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit found the hidden tail,
Past clouds of text and boilerplate.
The true cause hopped into view,
While smithy-diag faded away.
The CLI now tells the tale.

Comment @coderabbitai help to get the list of available commands.

@khaliqgant
khaliqgant merged commit e52f346 into main Sep 17, 2026
5 checks passed
@khaliqgant
khaliqgant deleted the fix/cli-error-snippet-elision-tail branch September 17, 2026 05:06
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