Skip to content

Choose every setting for the user, and add a monthly spending limit - #22

Merged
Abe-Borg merged 2 commits into
mainfrom
claude/wonderful-galileo-gs15bg
Dec 1, 2026
Merged

Abe-Borg merged 2 commits into
mainfrom
claude/wonderful-galileo-gs15bg

Conversation

@Abe-Borg

@Abe-Borg Abe-Borg commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

What this does

A user pastes an API key, signs in to the code site, and everything works. There is nothing to choose in Settings. Every setting is still there, behind Show advanced settings, with a value CodePull picked.

Settings screen

  • Opens with the API key, a line naming the model in use, a monthly spending limit, this month's usage, and About.
  • Models, text sharing, the look-at-the-page switch, step limits, pulling, pacing, the library, diagnostics and deleting data render only under Show advanced settings. The choice is remembered. A refused value in the hidden part opens it; links to pacing open it.

What CodePull now chooses

Before Now
Model, requests and plans Sonnet 5.5 / Opus 5.5 Automatic: the first Opus the key offers, for both
Effort: requests and the queue's search medium high
Effort: plans high xhigh
Effort: a look at a page low medium
Steps, request / plan 14 / 24 40 / 60
Largest plan 30 60
Working time before a run pauses to ask 15 min 60 min
The queue's search for a page 150k in / 24k out tokens, request steps no token budget, 24 steps of its own
A look at a page 16k out per step, 100k in, 15 steps no token limits, 40 steps
Tool result caps 1–8 KB 8–64 KB
Let Claude look at the page off on
Monthly spending limit none $200

Pacing, text sharing (Outlines) and the library settings are unchanged.

The spending limit is a kill switch

  • Read before every call to Claude, in the tool loop and in the look. Once the month's estimate reaches it, nothing is sent, for a request, a plan, the queue's search or a look.
  • A working request stops and asks; after the limit is raised, Continue goes on without using up a step allowance. A new request is refused with the reason. A queued pull that needs Claude stops with the reason and can be retried later. Pulls that need no help from Claude carry on.
  • It replaces the per-pull cost ceiling, which cannot exist without token budgets. The queue's third figure is now Left under your limit.
  • Each reply counts in the month it is recorded (claude_months, migration 0011), so a request continued into a new month is counted there. A request that failed part-way is not sent again past the limit. Both came out of review and are in the second commit.

Existing installs
Migration 0010 runs once: both models go to Automatic, a step limit or plan size still at the old default moves to the new one, and a stored "off" for looking at the page is removed. Values changed by hand stay, except a hand-picked model, which the app cannot tell from its own pick.

Things to know before merging

  • Rule 9 changed. The screenshot fallback is on by default (the owner's decision). CLAUDE.md, decision 8, the README and the tests that pinned "off by default" are changed with it. What the fallback can do is unchanged.
  • Decision 9 is partly reversed. The queue's fixed token budgets and the "at most" figures are gone. Decision 11 (docs/adr/0011-chosen-for-the-user.md) records the whole change and what was considered.
  • The limit can be passed by one call, since it is checked before a call and not during one. It counts by assets/pricing.json, so a model with no price there is not seen by it. Every model the app picks by itself is priced, and a test keeps it so.
  • No web search or web fetch was added. Decision 11 says why.
  • Nothing here has been run against the live site.

Verification

On the head commit, locally on Linux:

  • npm run build and npm run format:check pass.
  • npm test: 234 unit tests pass, including new ones for the automatic model, effort levels, the kill switch in the tool loop, the look and the queue, the month's spending, and both migrations.
  • npm run test:app under xvfb-run: all nine Electron checks pass, including a new one that drives the kill switch through the real screens.

CI passed on Windows, macOS and Linux for both commits.

https://claude.ai/code/session_01T34mysyME89SCok2YZSRT8


Generated by Claude Code

Settings now opens with the API key, the model in use and one spending
limit. Everything else is behind "Show advanced settings", with values
that work, and nothing was removed.

- Models are automatic: the first Opus the key offers, for requests and
  for plans. A pick by hand still wins. No model ID is written into the
  user's settings.
- Effort per kind of work, fitted to the levels a model reports: high
  for requests and the queue's search, xhigh for plans, medium for a
  look at a page.
- No call to Claude has a token budget. The queue's search has 24 steps
  of its own, a look 40, a request 40 and a plan 60, with 60 minutes of
  working time before a run pauses to ask.
- Tool results are capped at 8 to 64 KB, so a code list or a long
  outline arrives whole.
- Looking at the page is on by default (the owner's decision; rule 9 and
  its tests are changed with it).
- A monthly spending limit, $200 by default, is a kill switch: it is
  read before every call to Claude, by every kind of work. It replaces
  the per-pull cost ceiling, which no longer exists without budgets.
- Migration 0010 moves an existing install to the new defaults once and
  keeps values the user changed by hand.

Decision 11 records it; decisions 7, 8 and 9, the README, the user
guide, the architecture notes and CLAUDE.md are updated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34mysyME89SCok2YZSRT8
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T05:03:20.277866Z 6d0b89f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d0b89f5f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent/runtime.ts Resolved
Comment thread src/db/store.ts Resolved
…equest is sent again

Two gaps in the monthly spending limit, found in review.

- The month's spending was summed over runs by the month each began, so
  a run paused in one month and continued in the next went on uncounted.
  Each reply is now counted in the month it is recorded (claude_months,
  migration 0011, kept up by runs.save). Earlier runs count in the month
  they began. The table is not content: Delete all content keeps it.
- A model call that failed part-way could be sent again twice without
  the limit being read, and what the failed attempt cost was not saved
  until later. The partial usage is saved at once, and the limit is read
  before every request that is sent again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34mysyME89SCok2YZSRT8
@Abe-Borg
Abe-Borg merged commit 7fbafc5 into main Dec 1, 2026
4 checks passed
@Abe-Borg
Abe-Borg deleted the claude/wonderful-galileo-gs15bg branch December 1, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants