Skip to content

[A06] Computer Use failures appear successful across result boundaries #5449

Closed

Description

@testikun

Problem

A Computer Use call returns permission_missing or screen_locked, but Desktop shows a green completed icon. The same call is recorded as isError: false and counted as success in telemetry. Reloading the task preserves the incorrect status.

This surfaced while revisiting A06 (#4909). It is a result-contract problem across production and adaptation boundaries, not just an icon problem.

Two loss points are confirmed on bc9401d670259b87fbc40792ab83ea009c5f623c:

  • The producer can omit the failure fact. Some CU permission refusals return only { text: "...failed: permission_missing..." }. Runtime classifies that as a successful text result.
  • The adapter can discard an existing failure fact. Desktop native result projection converts the result into model content. ClientCapabilityCallResult carries only content/structuredContent, so even an existing error: 'screen_locked' can disappear before the Host settles the proxy call.

Ordinary MCP converts protocol isError into an exception. Client Capability reuses a similar content shape without that conversion.

Evidence

Controlled reproduction through the real ToolRuntime, CU implementation, SQLite T1/T2 commits and transcript projection:

Case Runtime / telemetry Reopened history
Accessibility missing, four identical calls Four successes; all four reach the tool Four completed results
screen_locked, direct tool path — control Error Errored
screen_locked, Desktop adapter/proxy path Success Completed
outcome_unknown, Desktop adapter/proxy path Success Completed

Users see success markers beside failure instructions; telemetry and repeated-failure accounting are wrong. Adding the error marker in the direct-path probe blocks the third/fourth attempts, but does not fix the Desktop path.

Permission denied, but four completed icons:

Permission denied while four calls show completed

The Desktop adapter loses screen_locked:

Screen locked through Desktop shows completed

The same error through the direct path is correctly shown as failed:

Direct screen locked control correctly shows failure

These are real Desktop captures replaying the generated ledger in an isolated profile. Permission/backend inputs and transport were controlled, not a live-model/TCC end-to-end run. Response contents were preserved. The model still receives failure text; no permission bypass or repeated real-world side effect was observed.

Reproduction scripts, full results and all six original screenshots: evidence bundle.

Environment: macOS 26.6.2 arm64, Node 24.20.0, Electron 43.4.1. Twelve scenarios / 21 settlements were consistent across two runs. Existing affected suites: 122 tests pass, without covering this status loss.

Related: #4909 (A06). Result-contract options and the proposed migration are discussed below.

Code inspection, controlled reproduction and drafting assisted by OpenAI Codex.

Activity

  1. testikun commented on Sep 17, 2026

    @testikun
    ContributorAuthor

    Design discussion: one tool result contract

    @Astro-Han — could you review the result boundary and migration scope below? This is adjacent to #4947's ownership question, scoped here to tool results and Desktop transport.

    We considered three directions:

    Option Benefit Remaining cost
    A. Patch the flags and preserve them in the adapter. Smallest bug fix. Arbitrary returns and scattered interpretation remain.
    B. Migrate CU / Client Capability first. Bounded migration covering these failures. New and legacy result contracts coexist.
    C. Migrate all Maka-managed tools to one ToolResult class. One result boundary; old inference paths can be deleted. Builtins, plugins, adapters and callers must migrate together, with an explicit compatibility cutover.

    Our preferred direction is C. The objective is fewer rules and less code to maintain, not a class hierarchy for its own sake.

    Why a shared result class

    Today later layers interpret arbitrary error, kind, status and model projections. A required ToolResult makes the distinctions explicit at the producer:

    Tool / external-protocol adapter
                  ↓
    ToolResult: outcome + business value + transcript/model views + delivery policy
                  ↓
    Shared validation and result finalization
                  ↓
    Existing commit boundary → history / UI / telemetry / caller
    

    The benefits we want are concrete:

    1. Explicit outcome across boundaries. Failure travels with the result instead of depending on text conventions.
    2. Less duplicated machinery. Classify at the producer/adapter, then remove shape guessing, duplicate assembly and repeated completion recipes.
    3. One plugin tool contract. Upgrade existing registration so builtins, plugins and remote adapters meet the same boundary.
    4. More local changes. New tools declare their semantics and views without adding tool-name branches to the common classifier.

    This follows Log Is the Runtime: preserve facts, then project them. Codex's ToolOutput is a useful reference for separating result semantics from model/log/caller representations, not a proposal to copy its entire architecture.

    Scope and acceptance

    • Migrate every Maka tool entry and direct consumer; adapt external MCP/provider protocols at ingress.
    • Keep outcome separate from business state and caller delivery: observing a failed process can succeed; structured failure need not always throw.
    • Preserve T1/T2, cancellation, uncertainty, privacy/media and provider-native replay.
    • Review in stages; cut over completely. Remove temporary live bridges, retain old-log readers and use explicit protocol/API compatibility gates.
    • Require measured net production-code reduction across all affected modules, including new classes/codecs/adapters. Extraction alone does not count; no speculative deletion percentage.

    The exact API and implementation slices can follow the discussion of this boundary and full-migration scope.

    Code inspection, controlled reproduction and drafting assisted by OpenAI Codex.

  2. testikun commented on Sep 17, 2026

    @testikun
    ContributorAuthor

    take

  3. Astro-Han commented on Sep 17, 2026

    @Astro-Han
    Contributor

    Verified both loss points on main; the bug is real:

    • CU permission refusals return { text } only (computer-use-tools.ts:1652), and deriveToolResultStatus (tool-runtime.ts:3413) defaults unlisted content kinds to success; the default is fail-open.
    • ClientCapabilityCallResult (client-capability.ts:76) carries no outcome field, so the Desktop proxy path cannot transport a failure fact even when the producer sets one.

    What this bug needs is bounded, and it does not need an architectural decision from us to proceed:

    1. CU produces an explicit error fact (an error field on the raw result or a dedicated content kind) instead of encoding failure in text.
    2. ClientCapabilityCallResult gains an outcome field that the Desktop projection preserves, so the fact survives transport to settlement.

    That is option B's scope, and it is the right fix for this issue. The default-success arm in deriveToolResultStatus deserves a second look in the same PR: the failure-streak loop gate depends on it, which is why a text-only failure lets a denied call retry indefinitely. One contract note if you extend the field: carry the tri-state (success/error/aborted), not a boolean, since isError already collapses aborted into error and the code notes it cannot drive live status.

    On option C: a unified ToolResult migration is a separate value proposition and a much larger commitment than this defect requires. This issue is not the venue to settle it, and you do not need our sign-off to fix the bug. If you want to pursue C, please open it as its own discussion with independent justification (is the kind-switch in deriveToolResultStatus a recurring defect source, and what does it cost to maintain), evaluated on its own merits.

  4. testikun commented on Sep 17, 2026

    @testikun
    ContributorAuthor

    Agreed, @Astro-Han. I'll proceed with option B for this issue:

    • Make CU refusals produce an explicit error fact.
    • Carry success / error / aborted through the Desktop capability result and Host settlement, preserving the outcome separately from model-facing content.
    • Review the default-success path and pin the behavior through live events, durable replay, telemetry and repeated-failure accounting. Successful observations of failed processes must remain successful.

    The full ToolResult migration and plugin API redesign are out of scope for this fix. Our investigation supports the result-loss defect, but does not yet establish that a full migration is the best way to reduce maintenance cost. Any further proposal for C will be a separate discussion with its own evidence and comparison against smaller alternatives.

    I'll keep the implementation scoped to this result path and its necessary compatibility/tests; the bug fix will not wait for an architectural sign-off.

  5. added
    bug
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions