paperclipai/paperclip · error

remote session budget updates require a connected remote pro

Error message

remote session budget updates require a connected remote provider session

What it means

The budget-update method only works for managed remote providers (claude_managed/aws_agentcore) with an active transport connection. Called on a local/mock provider session or before the transport is connected, it throws instead of silently no-oping the budget change.

Source

Thrown at packages/paperclip-runner/src/live/live-session.ts:2068

    this.#appendEvidence("session", turnId, { action: "stop_requested", reason });
    this.#emit({ turnId, kind: "activity", reason: "stop_requested" });
    await this.#transport.request("turn/interrupt", {
      threadId: this.#providerThreadId,
      turnId,
    });
    await this.#persist();
    return this.snapshot();
  }

  async increaseManagedSessionBudget(
    maxSessionListCostUsd: number,
  ): Promise<CapabilityLiveSessionSnapshot> {
    if (
      (this.#config.provider !== "claude_managed" &&
        this.#config.provider !== "aws_agentcore") ||
      this.#transport === null
    ) {
      throw new Error(
        "remote session budget updates require a connected remote provider session",
      );
    }
    if (!Number.isFinite(maxSessionListCostUsd) || maxSessionListCostUsd <= 0) {
      throw new Error("managed session spend ceiling must be positive");
    }
    await this.#transport.request("session/budget/increase", {
      maxSessionListCostUsd,
    });
    if (this.#config.managedProfile) {
      this.#config.managedProfile.maxSessionListCostUsd = maxSessionListCostUsd;
    }
    if (this.#config.agentCoreProfile) {
      this.#config.agentCoreProfile.maxEstimatedSessionCostUsd =
        maxSessionListCostUsd;
    }
    this.#status = this.#activeTurnId === null ? "warm_idle" : "running";
    this.#appendEvidence("session", this.#activeTurnId, {

View on GitHub (pinned to 01ad858492)

Solutions

  1. Ensure the remote session is connected (await connect/startup) before updating the budget
  2. Only call this method for claude_managed/aws_agentcore providers; skip or branch for other providers
  3. Check connection state via the session snapshot before calling
  4. Handle the throw to surface 'not connected' state to the UI/operator

Example fix

// before
await session.updateManagedRemoteSessionBudget(50); // may throw on local/disconnected
// after
if (session.provider === 'claude_managed' || session.provider === 'aws_agentcore') {
  await session.ensureConnected();
  await session.updateManagedRemoteSessionBudget(50);
}
Defensive patterns

Strategy: try-catch

Validate before calling

const isManaged = cfg.provider === 'claude_managed' || cfg.provider === 'aws_agentcore';
if (!isManaged || !session.isConnected?.()) throw new Error('budget update needs a connected managed remote session');

Try / catch

try {
  await session.updateManagedRemoteSessionBudget(usd);
} catch (err) {
  if (err instanceof Error && err.message.includes('connected remote provider session')) {
    // defer or reconnect, then retry
  } else throw err;
}

Prevention

When it happens

Trigger: Calling updateManagedRemoteSessionBudget (or equivalent) when #config.provider is not claude_managed/aws_agentcore, or when #transport is still null (session created but remote connection not established).

Common situations: Calling budget updates right after create() before connect completes; assuming the method works on mock/local adapter sessions; race where the transport dropped and was set to null.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-02). Data as JSON: /api/errors/a2396d590d9ad32e. Report an issue: GitHub.