Skip to content

desktop agent: make managed/local provider boundaries declarative #9407

Closed

Description

@Git-on-my-level

Context

PR #9402 fixed an incident where a desktop surface configured for managed piMono routing launched local Claude ACP from a background control path. The local process read a stale local Keychain credential and returned a provider 401. Omi Firebase auth was healthy; this was a cloud-to-local routing regression.

The PR also found related failures:

  • Managed control paths originally rejected only ACP, leaving local Hermes/OpenClaw overrides possible.
  • A background worker could try to fan out another agent; failed control calls could still end as a green parent Done.
  • Explicit User Claude OAuth needs strict URL validation and retry-safe browser-launch behavior.

The current PR contains containment fixes. This issue is the durable design follow-up so future adapters and control tools cannot recreate the class.

Confirmed product decisions

  • Managed Pi and any managed Claude fallback use Omi backend/cloud provider credentials. The desktop Firebase token authorizes Omi services only; it is not a local provider credential.
  • Local provider adapters are allowed only when the owning desktop surface explicitly selected that local-user mode.
  • A managed surface must fail closed for an unknown or locally credentialed adapter override.
  • Background, delegated, and floating-pill workers are leaf workers. They may complete their assigned objective but cannot create more agents.
  • A required agent-control operation that ultimately fails must not yield a green terminal completion.

Scope

  1. Replace string-specific routing checks with one declarative adapter trust/credential-scope registry.

    • Every registered production adapter declares managed_cloud or local_user.
    • New adapters cannot register without a scope declaration.
    • Managed control paths allow only managed_cloud adapters.
    • Apply the policy to spawn_background_agent, spawn_agent, run_agent_and_wait, and send_agent_message.
  2. Project agent-control capabilities by execution role.

    • Leaf-worker tool context should omit agent-spawning tools where the runtime can safely project availability.
    • Retain server-side enforcement as the authority boundary; prompt guidance remains defense in depth.
    • Do not rely on prompt text alone.
  3. Define terminal semantics for required control operations.

    • A failed spawn/delegate/continue must yield terminal failed or explicitly degraded, never succeeded/Done.
    • A later successful retry in the same turn may resolve the pending failure.
    • Preserve the kernel as the owner of session/run/attempt truth.
  4. Keep explicit local User Claude auth isolated.

    • Validate browser OAuth URLs before opening them.
    • Preserve retry after callback timeout without duplicate tabs for one attempt.

Acceptance criteria

  • There is one documented and tested credential-scope source of truth for all production adapters.
  • A test matrix covers every control entry point against every local adapter and an unknown adapter from a managed surface.
  • Leaf workers cannot discover or invoke nested-agent creation; server enforcement proves denial even for malformed or stale tool context.
  • Integration coverage proves failed child creation cannot result in a green parent terminal status, while a successful retry can complete.
  • Explicit User Claude mode retains its local auth behavior; managed modes never invoke local OAuth or inspect local provider credentials.
  • Product invariant references are updated as needed, especially INV-AGENT-* and INV-CHAT-1.

Non-goals

  • Do not move managed provider credentials onto the desktop.
  • Do not invalidate the Omi Firebase session for provider/BYOK/local-provider failures.
  • Do not add another transcript, session, or pill persistence store.
  • Do not remove the current safety guards while replacing them.

Verification

  • Focused runtime/control-tool and pi-mono tests.
  • Agent logic harness and exact pi-mono-extension tests.
  • Named non-production desktop bundle smoke: managed background work completes on cloud routing with no local ACP/Hermes/OpenClaw launch.
  • Negative smoke: forced required-control failure is visibly non-green.

Activity

  1. added
    chat
    p1
    security-review
    needs-maintainer-review
    on Jul 10, 2026
  2. added a commit that references this issue on Jul 10, 2026
    a41d216
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

    chatdesktopneeds-maintainer-reviewp1security-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions