Skip to content

Platform-started turns report raw provider failure text and subscription names into a person's Workspace thread #4482

Closed

Description

@pavshulin

Found in: v1.0.5-rc2 (af465288a), release-test row B22. Unchanged between rc1 and rc2 and identical on dev.

What happens

When a turn fails because the model credential is refused, the error stored on the execution carries the subscription walk trail, built from subscription names:

Authentication failure: Failed to authenticate. API Error: 401 OAuth access token is invalid.. Check subscription token or API key configuration. Tried: <subscription-name> (auth); every candidate refused.

For a turn the person sent themselves, the Workspace replaces this with a fixed person-safe sentence. For a turn the platform started and then reports into a person's Workspace thread, it does not: the thread gets a message

Didn't finish — failed
Authentication failure: … Check subscription token or API key configuration. Tried: <subscription-name> (auth); every candidate refused.

Observed in the browser as a Workspace-only account (role user): an agent's platform-started first turn failed on a rejected credential and the text above appeared in the person's Main conversation, naming the subscription.

Subscription names are operator data (commonly a person's or a plan's name), and "Check subscription token or API key configuration" is operator guidance. Neither belongs in front of a Workspace viewer or an external client.

Why (code)

  • The trail: src/backend/services/subscription_auto_switch.py:915-930 (trail_text, "Tried: A (rate limit) -> B (auth); every candidate refused."), appended to the row error at services/task_execution_service.py:3375, services/chat_execution_service.py:939, services/pull_coordination_service.py:862 (bug: a Workspace turn on a pull-pilot agent does not walk the subscription pool (SUB-003 walk is push-only) #3487).
  • Protected paths: the person's own Workspace turn (client_portal/service.py:3567-3613), public links (routers/public.py:876-883), inline channel turns (adapters/message_router.py:929).
  • Unprotected path: completion reports. services/channel_completion_report.py _portal_body (:588-593) and _summarize (:118-142) pass the raw error through _sanitized_detail (:82-115), which redacts credential patterns and truncates, nothing else. Its own docstring notes that raw failure text reaching a client "contradicted bug(workspace): failed turns are invisible to the client — fast failures misreported as "lost track", backend error discarded, Retry suppressed where it is safe #2320's rule that raw failure text is operator-only".
  • By the same code (not observed in a browser): schedule results delivered to a Workspace thread, delegated children, approved gate runs, background Slack/Telegram completion reports, and the Workspace Work card (client_portal/work/service.py:326, row error cut to 200 characters).

Tests

  • tests/unit/test_2320_portal_failed_turn_visibility.py:402-425 pins "no subscription / api key wording" for the person's own turn only.
  • tests/unit/test_ent457_portal_completion_report.py:204-209 asserts the raw error text appears in the portal body.
  • Nothing pins "no subscription name or operator guidance reaches a portal viewer" for completion reports or the Work card.

Expected

Completion reports and the Work card give non-operators the same person-safe failure sentence the own-turn path uses; the trail and the raw provider text stay on operator surfaces (execution detail, operator alert).

Reproduce

  1. Register a subscription whose token is rejected and assign it to an agent a Workspace-only account can open.
  2. Cause a platform-started turn whose result is reported into that person's Workspace thread (for example a schedule with Workspace delivery).
  3. Open the thread as the Workspace account.

Not verified

The own-turn auth_switched branch (client_portal/service.py:3593-3602) interpolates the new subscription's name into the person's message; whether it is reachable in practice was not tested.

Activity

  1. added
    priority-p2
    type-bug
    theme-security
    on Nov 11, 2026
  2. obasilakis commented on Nov 13, 2026

    @obasilakis
    Contributor

    /claim

  3. added
    status-in-progress
    on Nov 13, 2026
  4. github-actions commented on Nov 13, 2026

    @github-actions

    Claimed by @obasilakis. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/4482-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #4482
  5. added
    status-in-dev
    and removed
    status-in-progress
    on Nov 13, 2026
  6. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-securitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions