stacklok / stacklok/mecatl

Show complete provider errors when ctrl+t expands details

Open
#1,068 2 comments 0 reactions 1 assignee View on GitHub

@jbeda is already working on this.

Since Sep 4, 2026.

tui
Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

Bug description

Make permanent provider errors fully inspectable in mecatui with ctrl+t.

The collapsed error should remain concise, but expanding it should show every error detail that reached the mecatl client boundary, including the provider response body when one was received. This is needed to diagnose HTTP 4xx responses that otherwise expose only the status and request ID.

The current renderer intends to show block.raw under raw payload: when expanded, but the reported incident still left the operator without the provider rejection reason. Verify the complete path from provider SDK error through the server/client event projection and session replay, rather than changing only the renderer.

Expected behavior

  • Collapsed mode shows a concise, terminal-safe summary.
  • ctrl+t shows the complete error available at the mecatl boundary, including multiline text or JSON response content.
  • Expansion works for initial stream-establishment errors, in-stream errors, and restored session history.
  • If the upstream response had no body, the expanded view says so explicitly instead of implying that additional provider detail is hidden.
  • Terminal control sequences remain sanitized. Authentication headers, credentials, and other secrets must never be displayed or persisted.

Actual behavior

The reported HTTP 400 displayed the request URL, status, and provider request ID, but no provider rejection reason. Expanding the error did not provide enough information to determine whether the request was invalid or the response body had been lost upstream.

Environment (if relevant)

  • Provider: Anthropic-compatible Messages API through Sprout
  • Model: claude-opus-4-8
  • Deployment shape: mecatui

Additional context

Relevant paths:

  • cmd/mecatui/ui/render.go: renderPermanentError
  • cmd/mecatui/ui/conversation.go: permanent error storage
  • provider/anthropic/anthropic.go: SDK stream error propagation
  • internal/adapter/llmresilience/llmresilience.go: establishment failure handling
  • engine/agent/loop.go: agent: start stream wrapping

Add end-to-end regression coverage for an HTTP 400 with a JSON body, a multiline body, and an empty body. The test should establish whether detail is lost in the provider adapter, resilience wrapper, event projection, persistence/replay, or rendering layer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.