# Platform-neutral Provider Errors

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "platform-neutral-provider-errors-2026-08-21",
  "problems": [
    {
      "problemId": "agent9-provider-error-leaks-runtime-backend",
      "summary": "An Agent9 Managed Tool application error discarded its structured Provider result and projected an Agent9-specific fallback into the otherwise transport-independent evidence handoff.",
      "status": "optimized_unverified",
      "applicability": "Agent9-backed evidence acquisition in which a selected Managed Provider Tool returns an application-level or malformed failure result.",
      "issueKeys": ["ST-2865"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/ST-2865#problem:agent9-provider-error-leaks-runtime-backend"],
      "signalTextIncludesAny": [
        "agent9_managed_provider_failed",
        "agent9 managed tool returned",
        "provider error differs by runtime backend"
      ],
      "observedThrough": "2026-08-21",
      "effectiveAt": "2026-08-21T05:50:54Z",
      "verifiedAt": null,
      "attemptedAction": "Preserve a failed Managed Tool's structured provider-result-v1 and emit only the exact safe Provider error or a platform-neutral Tool/result fallback in the canonical evidence handoff.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/actions/runs/32451941070"
    }
  ]
}
-->

- Owner: Agent9 adapter and deterministic Provider materializer
- Source: ST-2865 Agent9/Kubernetes comparison
- Implementation status: deployed from `6ebbe06df3925961bfb1005396acbff36dfbee7f`
- Effective status: `optimized_unverified`

## Bounded problem

An application-level Managed Tool failure was represented as a failed Codex
Tool item without its structured Provider result. The materializer consequently
lost the exact Provider error and placed an Agent9-specific fallback in the
transport-independent child evidence handoff.

## Implemented change

Keep `provider-result-v1` attached to failed Tool items, preserve its safe exact
Provider error code, and use `provider_tool_call_failed` or
`provider_result_invalid` only when the Provider did not supply a usable code.
Backend-specific identity remains available in Agent9 operation traces but does
not enter diagnostic semantics.

The unified staging release published the same Skill source and image lineage
to both runtimes. The passive Agent9-backed Deployment is Ready on exact commit
`6ebbe06df3925961bfb1005396acbff36dfbee7f`; the active Kubernetes Deployment
is Ready on its direct descendant `455679d14350a088d3490ee30daee5d3c3a2c485`,
which contains the same fix.

## Next validation action

After deployment, replay one non-Wetech case containing a failed Managed
Provider operation and verify that the compact report and child handoff contain
the exact Provider error or platform-neutral fallback and no `agent9_` error
code or message.
