From cc437aad642ac0c3894b19159dc6aee6caeb8732 Mon Sep 17 00:00:00 2001 From: scgopi Date: Fri, 2 Oct 2026 19:39:15 -0700 Subject: [PATCH] Nod: no spend cap by default The cap stopped unattended Nod loops (timed loops and composite children) at $2 a run on the Claude engine. It now defaults to 0, no cap, in both the app and the runtime; a cap set in Settings > Agents > Nod still applies, and a saved setting keeps its value. Co-Authored-By: Claude Opus 5.5 Signed-off-by: scgopi --- GraphcodeKit/Sources/Domain/NodSettings.swift | 6 +++--- NodRuntime/src/settings.ts | 2 +- NodRuntime/test/defaults.test.ts | 6 ++++++ graphcode/Tests/NodBackendTests.swift | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 NodRuntime/test/defaults.test.ts diff --git a/GraphcodeKit/Sources/Domain/NodSettings.swift b/GraphcodeKit/Sources/Domain/NodSettings.swift index 5757eeb1..7cc445b4 100644 --- a/GraphcodeKit/Sources/Domain/NodSettings.swift +++ b/GraphcodeKit/Sources/Domain/NodSettings.swift @@ -37,8 +37,8 @@ public struct NodSettings: Codable, Equatable, Sendable { public var messagesOtherLoops: MessagePolicy /// Shell patterns that run without asking, e.g. `swift test *`. public var shellAllowlist: [String] - /// Per-run cap for unattended loops (timed and composite children), in dollars; 0 is no - /// cap. Copilot reports premium requests instead and is capped by its plan. + /// Per-run cap for unattended loops (timed and composite children), in dollars; 0, the + /// default, is no cap. Copilot reports premium requests instead and is capped by its plan. public var spendCapUSD: Double /// MCP servers from the project's `.mcp.json` switched off for Nod, by name. The /// built-in graphcode server is always on and never listed here. @@ -55,7 +55,7 @@ public struct NodSettings: Codable, Equatable, Sendable { editsOutsideWorktree: Ask = .never, messagesOtherLoops: MessagePolicy = .draftForMe, shellAllowlist: [String] = [], - spendCapUSD: Double = 2, + spendCapUSD: Double = 0, disabledMCPServers: [String] = [] ) { self.engine = engine diff --git a/NodRuntime/src/settings.ts b/NodRuntime/src/settings.ts index 62cc504b..76d39c79 100644 --- a/NodRuntime/src/settings.ts +++ b/NodRuntime/src/settings.ts @@ -31,7 +31,7 @@ export const defaultSettings: NodSettings = { editsOutsideWorktree: "never", messagesOtherLoops: "draftForMe", shellAllowlist: [], - spendCapUSD: 2, + spendCapUSD: 0, disabledMCPServers: [], }; diff --git a/NodRuntime/test/defaults.test.ts b/NodRuntime/test/defaults.test.ts new file mode 100644 index 00000000..edbae451 --- /dev/null +++ b/NodRuntime/test/defaults.test.ts @@ -0,0 +1,6 @@ +import { expect, test } from "bun:test"; +import { defaultSettings } from "../src/settings"; + +test("Nod runs uncapped unless a person sets a spend cap", () => { + expect(defaultSettings.spendCapUSD).toBe(0); +}); diff --git a/graphcode/Tests/NodBackendTests.swift b/graphcode/Tests/NodBackendTests.swift index 9bc000af..fca52a09 100644 --- a/graphcode/Tests/NodBackendTests.swift +++ b/graphcode/Tests/NodBackendTests.swift @@ -183,6 +183,7 @@ struct NodSettingsTests { #expect(settings.nod == NodSettings()) #expect(settings.nod.editsInWorktree == .auto) + #expect(settings.nod.spendCapUSD == 0) #expect(settings.nod.editsOutsideWorktree == .never) #expect(settings.nod.messagesOtherLoops == .draftForMe) }