← Back to Pull requests

feat(agents): a defined agent works without the node user's own settings (M3, D1561) #331

Open
unknown opened this pull request with 407 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 28, 2026 20:03 UTC
Author

What

M3's first L3 leak (docs/plans/agents.md → M3, D1561): a defined agent's runtime no longer loads the node machine user's own settings.

  • AgentDefinition.userSettings (a team member's too, through TeamMember): off when unset; agents.update can unset it; AgentRecord.userSettings when set.

  • TurnRequest.userSettings (agent.runtime@1.16, additive): jhin.agents sends current.userSettings ?? false for every defined agent's turn. Runtimes as implicit agents (the owner's threads) send nothing and load everything as before.

  • jhin.agent-claude: userSettings === false → settingSources: ["project", "local"] (no user), part of the launch key (D99). One spread in turn.ts, kept small and separate from W45's agent-claude work.

  • Deferred (agents.md): Codex/OpenCode, the toggle in Civilization's agent form, the account's claude.ai connectors (they come with the sign-in).
  • Before (the L3 run): the crew's closing words and answers to asks came in Russian, from the owner's personal ~/.claude/CLAUDE.md.

    Evidence

    The SDK's default when settingSources is omitted is "all sources" (sdk.d.ts 0.3.302: "When omitted, all sources are loaded (matches CLI defaults)"). A probe on this machine (claude-haiku-4-5, systemPrompt: claude_code preset, cwd /tmp/m3-probe), asking which language its instructions name, whether a private CLAUDE.md/auto-memory is in context, and which skills it sees:

    restricted: (1) NONE (no blanket language instruction …); (2) no; (3) dataviz, update-config, keybindings-help, code-review, simplify.
    all: Russian; yes; cavecrew, caveman, code-review, dataviz, workflow-authoring.
    

    Both ran signed in (the sign-in is not a setting source).

    $ vp test run plugins/agent-claude/test/turn.test.ts plugins/agents/test/agents.test.ts
     Test Files  2 passed (2)
          Tests  64 passed (64)
    

    New tests: leaves the node user's own settings out only when the turn says so (D1561) (agent-claude), and the defined agent's first turn request carries userSettings: false (agents).

    pnpm verify --affected: lint, typecheck, build and unit tests ran; Test Files 2 failed | 327 passed, Tests 3 failed | 3272 passed: three 5 s timeouts under load in plugins/preview/test/preview.test.ts (2) and plugins/source-control/test/setup.test.ts (1), files this change does not touch; rerun alone below. The E2E part was stopped locally (CI runs it).

    Rerun alone through the limiter:

    $ vp test run plugins/preview/test/preview.test.ts plugins/source-control/test/setup.test.ts
         × lets the cleanup remove a deleted thread's worktree with clean submodules, and keep a dirty one (D1134) 5052ms
     Test Files  1 failed | 1 passed (2)
          Tests  1 failed | 60 passed (61)
    

    The preview cases pass alone. The submodule case fails the same way on origin/main (detached at 624af51a): Error: Test timed out in 5000ms, so it is this machine, not this change.

    Other steps of pnpm verify --affected: ✓ check, ✓ typecheck, ✓ knip, ✓ public-ids, ✓ pack ("ok: the packed CLI runs from node_modules; workspace manifests untouched"; plugins/agent-fake/package.json now provides agent.runtime 1.16.0).

    🤖 Generated with Claude Code

    Diff: 407 lines (+305 / -102) across 5 files Reviewer: claude[bot] Review duration: 7m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.50) × (1 − Review Confidence (0.39)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 407 lines diff across 5 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 70% · Reviewer familiarity: 35%
    39%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.360
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #331"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 39.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.8% (MEDIUM) · Higher = larger blast radius
    49.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 39.4% · Lower = rushed or shallow review
    39.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.2% · Safe to merge
    30.2%
    Repository