Repository navigation
fix(telegram): show only user-worded ACP failure reasons - #19713
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS A user-worded [DESIGN-REVIEWED] d5b87bb Description read[DESCRIPTION-READ] 0971091e01fc3e786935c044492227554629da6ebeb702cd9320a3e1261b7b6a That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The positive tests now set What this change shipsInventory (3 items) — 3 justifiedIntent: when a Telegram turn fails, show the error's own text only if Kiro Crew wrote it for a person. FIX (#18439).
[FIRST-PRINCIPLES-REVIEWED] d5b87bb Description read[DESCRIPTION-READ] 371a83a4614191c2846aa63728ffed75469c8e295145ab38f43444778477ecc6 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Backend Tests (Windows) (6) failure is not caused by this PR. The one failing test is Evidence:
Re-ran the failed jobs. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: limits the failure reasons a Telegram chat shows to errors worded for a person, so a provider's raw fallback text gets the generic reply; updates the boundary baseline and tests.
Problem / Motivation
Goal: A failed Telegram turn shows the error's own text only when Kiro Crew wrote that text for a person; any other failure gets the generic retry reply.
When a turn fails on the Telegram transport path,
_user_safe_failure_reasoninsrc/kiro_crew/telegram/transport_dispatch.pydecides whether to show the error's message. It checkedexc.transient is not False. That flag only says "do not retry". The ACP error formatter sets it on its fallback too, and the fallback passes the provider's own text (or the raw error dict) straight through. So a non-retryable error that no curated branch matched reached the Telegram user as raw provider text under⚠.Why it matters
Telegram users can be shown provider-internal text (redacted for credentials and paths, but still not written for them) instead of the plain retry reply. Slack fixed the same gap in #15190, so the two transports disagree on the same error.
Not a goal
user_wordedortransient.What changed (motivation → approach → change)
A non-retryable ACP error with provider text leaked into Telegram chat, because the gate read the retry flag (
transient) instead of asking "did Kiro Crew word this?".AcpError.user_worded(added in #15190) answers that question, and the shared helperis_user_worded_failureinagent_sdk/drivers/acp_vocab.pyalready wraps it for Slack: worded, not retryable, and not a timeout or process death.Telegram's gate now calls that same helper. A private-memory refusal still shows its reason. Every other failure, including the provider-text fallback, gets the generic reply.
The facade no longer imports
AcpError, its last ACP-layer import, so.github/agent-sdk-boundary-baseline.txtdrops its entry and the composition contract test records that the facade now holds no agent-SDK import and bindsis_user_worded_failure.Backwards compatibility
Compatible: the reply shape is unchanged. Errors that are not user-worded move from showing their text to the generic reply, which matches Slack since #15190. That includes
transient=Falseerrors raised withoutuser_worded(for exampleAcpSandboxInitFailed, whose text embeds the child's stderr) and the timeout / process-death types the shared helper excludes.Reader:
src/kiro_crew/telegram/transport_dispatch.py:AcpError(facade name dropped) -- entry: chat -- no module or test readsAcpErrorthrough the Telegram facade; every caller imports it fromkiro_crew.acp.Tests
test/test_telegram.pyTestUserSafeFailureReason::test_non_retryable_provider_fallback_returns_none: atransient=Falseerror withoutuser_wordedreturns no reason. Red on main, green here.TestTurnLifecycleCharacterization::test_close_gets_the_failure_reason_the_turn_classifiedgains the same fallback case end to end: the renderer'sclose()getsNone.user_worded=True, matching what the real formatter raises for curated wording.test/test_telegram_transport_dispatch_composition_contract.pylistsis_user_worded_failureinBASE_NAMES;test/test_acp_error_surface.pyhas one docstring updated to the new gate.Manual verification
N/A — unit coverage sufficient: the change is one predicate, and the tests drive both the helper and the full dispatcher turn.
Related Issues
Fixes #18439
Pattern harvest
Rule candidate: review-prompt
Pattern: a chat surface gating "show this error's text" on a retry flag (
transient) instead of on the error'suser_wordedprovenance.Checklist