Skip to content

fix(tui): keep agent report failures private - #11391

Closed
lawrencecchen wants to merge 3 commits into
mainfrom
fix/pr11165-agent-report-privacy-main
Closed

lawrencecchen wants to merge 3 commits into
mainfrom
fix/pr11165-agent-report-privacy-main

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up extracted from PR #11165, rebased onto live main.

Agent report projection/database failures now return the stable public operation.failed response while typed validation errors remain unchanged. Raw error chains are logged internally. The behavior test corrupts a projection and verifies terminal IDs, revisions, database text, and projection details are absent.

This PR intentionally excludes the stacked screen-detection interpreter identity work, which is not present on main and is coupled to the stale AgentRecord.agent schema drift.

Verification: standalone rustfmt --check was run. It reports pre-existing formatting differences in this file under local rustfmt 1.8.0, also present on unmodified main. git diff --check passes. Cargo and Rust tests were not run, per task scope.


Summary by cubic

Fixes agent report failures so projection and database errors no longer leak internal details into the public response. These failures now return the stable operation.failed error with a generic message, raw error chains are logged internally, and typed validation errors keep their original response.

  • Corrupted projections return could not read agent state instead of exposing terminal IDs, revisions, database text, or projection details.
  • Adds a regression test verifying this.

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

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for agent operations.
    • Unexpected failures now return a clear, generic error message.
    • Prevented internal diagnostics and terminal identifiers from appearing in user-facing responses.

@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cmux166 Canceled Canceled Sep 1, 2026 4:40pm UTC
cmux41 Canceled Canceled Sep 1, 2026 4:40pm UTC

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 4359caff-fe0c-42c8-9612-865846ea429f

📥 Commits

Reviewing files that changed from the base of the PR and between 05f1463 and d0b872c.

📒 Files selected for processing (1)
  • cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs

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


📝 Walkthrough

Walkthrough

agent.report now sanitizes generic commit failures while preserving typed resource errors. The regression test verifies the public error response and confirms that internal terminal and storage details are not serialized.

Changes

Agent report error handling

Layer / File(s) Summary
Error mapping and regression coverage
cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs
agent.report preserves typed ResourceErrors, logs unexpected failures, and returns a sanitized operation.failed response. The regression test verifies that terminal, revision, database, and projection details are not exposed.

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

Merge Risk: ⚪ Minimal · up to d0b87

The change keeps agent report failures private while preserving typed validation errors, and no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: keeping TUI agent report failures private.
Description check ✅ Passed The description explains what changed, why it changed, the test added, and the verification performed. It omits the template's Demo Video, Review Trigger, and Checklist sections, but the core informat…
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.
Cmux Swift Actor Isolation ✅ Passed The isolated pull-request diff contains only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. It contains no Swift, Xcode project, or Swift package changes. The Swift f…
Cmux Swift Blocking Runtime ✅ Passed PASS: The exact PR range from 6ba2b02d64 to HEAD changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The diff contains no Swift paths or blocking-runtime …
Cmux Browser Automation Off-Main ✅ Passed PASS: The PR changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs. It does not change browser socket routing, WebKit/AppKit access, worker policy, or policy tests. The rule’s …
Cmux Expensive Synchronous Load ✅ Passed PASS: The pull request changes only one Rust file, cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, with no .swift files in the PR range. The Swift-specific expensive synchronous lo…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. No Swift, TypeScript, or JavaScript files changed in the PR range, so this cache-su…
Cmux No Hacky Sleeps ✅ Passed PASS. The PR diff from 6ba2b02 to d0b872c changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The custom check covers TypeScript, JavaScript, shell, and…
Cmux Algorithmic Complexity ✅ Passed PASS: The PR changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The production change is a single error-mapping call and a constant-time mapper; it adds no s…
Cmux Swift Concurrency ✅ Passed PASS: The pull-request range 6ba2b02..HEAD changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The exact diff contains zero .swift files, so it introduce…
Cmux Swift @Concurrent ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs. The verified diff contains no Swift files, @concurrent, or nonisolated async changes. The Swif…
Cmux Swift Package Boundaries ✅ Passed PASS: The pull-request range contains one changed file, cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. It contains no production Swift changes. Therefore the SwiftPM …
Full details: Description check

Explanation

The description explains what changed, why it changed, the test added, and the verification performed. It omits the template's Demo Video, Review Trigger, and Checklist sections, but the core information is complete.

Full details: Cmux Swift Actor Isolation

Explanation

The isolated pull-request diff contains only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. It contains no Swift, Xcode project, or Swift package changes. The Swift files visible in nearby history belong to the preceding unrelated commit, not this pull request. Therefore, the check is not applicable and introduces no Swift actor-isolation issue.

Full details: Cmux Swift Blocking Runtime

Explanation

PASS: The exact PR range from 6ba2b02d64 to HEAD changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The diff contains no Swift paths or blocking-runtime primitives. The Swift-specific check is not applicable.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS: The PR changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs. It does not change browser socket routing, WebKit/AppKit access, worker policy, or policy tests. The rule’s source-of-truth files are unchanged, so no stated failure condition applies.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS: The pull request changes only one Rust file, cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, with no .swift files in the PR range. The Swift-specific expensive synchronous load check is not applicable.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. No Swift, TypeScript, or JavaScript files changed in the PR range, so this cache-substitution check does not apply.

Full details: Cmux No Hacky Sleeps

Explanation

PASS. The PR diff from 6ba2b02 to d0b872c changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The custom check covers TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. No covered-language paths or added sleep/timer/polling delays appear in the diff.

Full details: Cmux Algorithmic Complexity

Explanation

PASS: The PR changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The production change is a single error-mapping call and a constant-time mapper; it adds no scalable collection scan, batch rescan, sort, filter, join, or slower data algorithm. The only added loop is test-only and iterates over four fixed strings, which the rule explicitly permits.

Full details: Cmux Swift Concurrency

Explanation

PASS: The pull-request range 6ba2b02..HEAD changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. The exact diff contains zero .swift files, so it introduces no Swift concurrency pattern covered by this check.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs. The verified diff contains no Swift files, @concurrent, or nonisolated async changes. The Swift-specific check is not applicable.

Full details: Cmux Swift Package Boundaries

Explanation

PASS: The pull-request range contains one changed file, cmux-tui/crates/cmux-tui-core/src/resource_router/auxiliary.rs, which is Rust. It contains no production Swift changes. Therefore the SwiftPM package-boundary rule is not applicable.

  • 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/pr11165-agent-report-privacy-main

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

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

@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.

No issues found across 1 file

You’re at about 91% 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.

Re-trigger cubic

@lawrencecchen
lawrencecchen force-pushed the fix/pr11165-agent-report-privacy-main branch from 05f1463 to 8bb13b9 Compare September 1, 2026 08:54
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Superseded by the current-main replacement #11410. PR 11410 carries the same agent-report privacy fix on branch fix/pr11165-agent-report-privacy-wave190 at head 1d54afecb484b688aaf871dd36b4046c7b0278f0; this PR remains based on the older snapshot. Closing this duplicate keeps review focused on the replacement.

This branch was successfully deployed

2 active deployments
Preview – cmux41 — d0b872ce Deployed Sep 1, 2026 by vercel[bot]
Preview – cmux166 — d0b872ce Deployed Sep 1, 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