Skip to content

fix: show rejected dashboard drafts as drafts, with readable receipts - #355

Merged
vishr merged 1 commit into
mainfrom
fix/corrected-drafts
Oct 19, 2026
Merged

vishr merged 1 commit into
mainfrom
fix/corrected-drafts

Conversation

@vishr

@vishr vishr commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Problem

  • When the agent builds a dashboard, the save check can reject a draft (an empty or invalid panel), and the agent then corrects it. Chat counted that rejection as "1 step failed", although the dashboard was saved.
  • Rejections reached clients as the generic tool_failed code. The MCP error middleware then re-presented diagnoses that were already presented, which could collapse a diagnosis naming an observed route into "Could not read the requested data."
  • Build receipt chips and details exposed spec ids and paths, for example Fixed p95_by_operation.query.sort and ~ latency.query.

Change

  • Dashboard tools return error.code invalid_spec for a spec rejection, with the presented problems alongside it, matching the HTTP API. A stale base version returns dashboard_version_conflict, the HTTP API's code. dashboardToolError is the single classifier, and restore uses it too.
  • normalizeToolErrors no longer re-presents invalid_spec messages.
  • Chat lists these rejections as "N drafts rejected". Expanding the list shows each problem message under its panel's title, without spec paths or the hints meant for the agent. Real failures keep "N steps failed". The build receipt already states whether the dashboard was saved.
  • Receipt and history chips, details and warnings name panels by title and fields in plain words, e.g. ~ P95 latency: SQL, chart type · moved and Fixed P95 latency.

An earlier iteration tried to hide a rejection once a later save appeared to correct it. Each review round found another case where that inference hid a real failure, so this PR shows every rejection instead, under an accurate label.

Verification

  • just check
  • just e2e: 78 passed
  • Go tests cover the codes, the presented problems and the route-bearing diagnosis.
  • UI tests cover the rejected-draft label and details, readable chips and receipt titles.
  • Several adversarial review rounds; the remaining concerns were addressed, except author-supplied ids inside validation messages, such as a duplicate panel id, which are deliberately kept.

Dashboard save rejections were reported with the generic tool_failed code,
so chat counted a draft the agent then corrected as a failed step, and the
middleware re-presented already-presented diagnoses, which could collapse a
diagnosis that names an observed route into the generic read failure.

Dashboard tools now answer a spec rejection with error.code invalid_spec and
the presented problems, matching the HTTP API, and a stale base version with
dashboard_version_conflict. Chat lists these as "N drafts rejected" with the
problem messages under the panel's title, and keeps "N steps failed" for
real failures; the build receipt reports whether the dashboard was saved.
Receipt and history chips, details and warnings name panels by title and
fields in plain words instead of spec ids and paths.

Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
@vishr
vishr merged commit f42e67b into main Oct 19, 2026
16 checks passed
@vishr
vishr deleted the fix/corrected-drafts branch October 19, 2026 04:54
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