fix(tui): keep agent report failures private

Closed
LA
2mo ago
+67-1

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.

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.