Skip to content

Pass Claude connection environment from user settings to runner children #307

Done

Description

@xfalcons

Implemented in the local working tree. childEnvironment passes the source environment to the provider adapter. Claude alone reads ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN from its config home settings.json env as defaults; explicit process environment wins. CLAUDE_CONFIG_DIR is honored, missing settings preserve normal login, and invalid settings produce sanitized errors. Project-only settings, strict MCP configuration, tool restrictions, parent identity removal, and writer Git isolation remain in place.

Regression evidence: before the fix, four of the five initial focused checks failed, including the preflight returning unauthenticated without its connection variables. After the fix, all 13 childEnvironment checks pass. The full Bun suite passes all 518 tests on Node 24; strict typecheck, static invariants, plugin validation, generated catalog checks, and git diff --check pass.

A real source-runner Claude GLM probe completed with modelVerified true and reportedModel glm-5.3, and returned the expected marker. An in-memory check confirmed that the actual configured token was absent from the receipt, output, raw stdout/stderr, and launcher log. The receipt retained project-only settings, strict MCP configuration, and the existing read-only tool allowlist and denylist. No token values were published.

Activity

  1. ericlitman commented on Dec 1, 2026

    @ericlitman
    Owner

    Opened PR #313: #313

  2. ericlitman commented on Dec 1, 2026

    @ericlitman
    Owner

    #307: Pass Claude connection environment from user settings to runner children

    Merged in PR #313 (97ee8708, queue head e87f1d24).

    • Forward connection settings from <CLAUDE_CONFIG_DIR or ~/.claude>/settings.json to external Claude runner children while keeping --setting-sources project, strict MCP/tool lockdown, and receipt redaction: done differently — Reader correction (Replace README flowchart with informative pstack workflow image #10): Two differences from the original ticket. First, claude.ts hostConfig is all-or-nothing rather than per-key: it reads settings.json only when the process environment sets none of ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, or ANTHROPIC_API_KEY. Second, PR fix(runner): Claude sandbox failure detection, settings.json env fallback, and FORCE_COLOR test fix #313 also forwards apiKeyHelper via --settings (and redacts it in receipts) because the first pro14 live gate failed runner-not-run when --setting-sources project dropped apiKeyHelper. Proved live for the apiKeyHelper path via pro14 live gates on 872807b6 (comment 7313916626) and e87f1d24 (comment 7314022499, evidence /private/var/folders/w8/z8fzv6v14_3gvvx2rmp9l6780000gn/T/open-pstack-evidence-313c.SjoaMQ) and a studio1 Claude 2.1.333 loopback repro; the ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN pair path is unit-tested only on the shipped candidate (the ticket's GLM probe ran before this candidate).

    Full checked closeout record: projects/open-pstack/records/2026-12-01-batch-293/closeout.md (Open Pstack v1.22.0).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions