Skip to content

t3_environment_link ignores requestedAccess when the machine is already linked, so agents can't ask for more access #38632

Open

Description

@arifali123

What happened

An agent needs more access on a linked machine than the read-only link allows, so it calls t3_environment_link with a higher requestedAccess. No card appears. The tool returns linked with the old read-only access, and the agent's next call is refused again. The user is never asked.

This happened on two machines (arif-linux and m5max), both reached over T3 Connect. The first time, the agent unlinked and requested a fresh link. The first card after that failed, because it offered to reuse the link that had just been removed.

Diagnosis

  1. Existing links skip the card whatever access is requested. apps/server/src/peer/PeerLinkRequests.ts:212-243 returns an existing link as linked without comparing linked.access with input.requestedAccess.
  2. The card can't raise access either. apps/web/src/components/chat/LinkRequestCard.tsx:214,241 sets useExisting = target.linked, which skips the access step. The mobile card looks the same. Raising access already works through Settings → Link ("Linking again renews it"), since PeerLinks.link replaces the token (PeerLinks.ts:541-572).
  3. Stale card after an agent unlinks. The card reads linked from peerLinkEnvironment.list (cached 10 s, refreshed only after link actions in the app). t3_environment_unlink doesn't notify clients, so the card offered use-existing, and answerOutcome (PeerLinkRequests.ts:307-325) failed the card permanently.

Steps to reproduce

  1. Link machine B from A with Read-only access.
  2. In a thread on A, ask the agent to create a project or delegate a task on B. The call is refused ("approved for read-only access").
  3. The agent calls t3_environment_link({environmentId: B, requestedAccess: "full-access"}).
  4. Expected: a card asking for the higher access. Actual: {"status":"linked","access":"read-only"} right away, with no card.

Variant: t3_environment_unlink(B), then t3_environment_link(B, …) within a few seconds. The card offers the removed link, and approving it fails the card with "no longer linked here".

Version

  • 0.1.10-nightly.20261116.4761 (Mac mini desktop and arif-linux server): first repro.
  • 0.1.11-nightly.20261117.4851 (Mac mini desktop): second repro, against m5max.

The code in question is unchanged on main as of 2026-11-18.

Environment

  • Host: T3 Code Desktop (nightly) on macOS 27.2 (Darwin 27.2.0, arm64), Node v24.22.1.
  • Linked machines: arif-linux (Ubuntu 24.04, x64, same nightly) and m5max (macOS), both reached over T3 Connect.
  • Providers: Codex (gpt-6-astra) in the first thread, Claude Agent (claude-opus-5-5) in the second.

Evidence

# 0.1.10-nightly, arif-linux, UTC 2026-11-16
07:07:35 t3_environment_link {requestedAccess:"approval-required"} → {"status":"linked","access":"read-only"}  (no card)
07:08:41 t3_environment_unlink → removed
07:08:58 new card → failed: "That environment is no longer linked here, or its link expired."
07:09:33 retry card → linked, full-access
# 0.1.11-nightly, m5max, UTC 2026-11-18
07:09:51 t3_project_create → capability_denied "approved for read-only access"
07:09:56 t3_environment_link {requestedAccess:"full-access"} → {"status":"linked","access":"read-only"}  (no card)

Related issues

None that match. Nearby: #30455 (wrong error message when a linked environment's access is the limit), #26527 (delegated tasks don't show approvals on the parent), #26772 (a revoked token breaks the link silently).

Fix applied or workaround

Settings → Linked environments → Link: pick the already-linked machine and choose the higher access ("Linking again renews it"). Don't use Forget first. Nothing on the machines was changed during triage.

Filed by

Claude Code (claude-opus-5-5), running t3 triage inside T3 Code.

Activity

  1. added
    via-triage
    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

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions