Skip to content

feat(fix): run only with the Agent SDK; ask before the first download, never fall back - #239

Merged
lucasbraum merged 3 commits into
mainfrom
lucasbraum/sdk-required
Oct 18, 2026
Merged

lucasbraum merged 3 commits into
mainfrom
lucasbraum/sdk-required

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Product rule: uptide fix runs only with the Claude Agent SDK executor. If it can't, it doesn't run.

What changes

  • Asks once before the first download. On an interactive terminal (stdin and stderr are TTYs), the first fix without a usable SDK asks:
    uptide fix needs the Claude Agent SDK (about 300 MB, downloaded once to ~/.cache/uptide/agent-sdk/0.3.296). Download now? [Y/n]
    
    Enter or y downloads it. With --yes, or without a terminal, it downloads without asking and prints the existing one-line notice (Agent SDK 0.3.296 is not installed: installing it once into … 295 MB, reused by later runs). An SDK that is already cached, or installed next to Uptide, is never asked about.
  • Stops instead of falling back. It exits 2 right after the Repository phase (local reads only, so an unsupported or dirty repository is named first), before any clone, install, network call or model call. One message gives the reason and the fix, and --json returns it as {"error":{"code":"SDK_UNAVAILABLE","message":…}}. It stops when:
    • the answer is n or Ctrl-C (… cannot start: the download was declined. To fix it, run again and answer Y, or pass --yes);
    • the SDK can't be fetched or loaded, or has no binary for the platform (the message gives npm's error and how to fix it: registry or proxy, or install the SDK next to Uptide);
    • ANTHROPIC_API_KEY is not set, or another provider is selected (as decided in the session: OpenAI/Gemini and keyless runs are refused);
    • uptide.yml sets llm.enabled: false or executor: patch.
  • No patch fallback anywhere. fix() in core throws SDK_UNAVAILABLE where it used to switch to patch. sdkFallbackNote, llm.sdkMissing and the PR-body banner are gone. The Action (the App runs through it) stops the run up front on executor: patch. When a fix comes back SDK_UNAVAILABLE, it stops the whole run with the CLI's message, marks that row failed and leaves the rest available.
  • Hidden flags. --no-llm, --agent and --provider are hidden from fix --help. --no-llm and --agent patch are refused (exit 2) unless UPTIDE_INTERNAL=1, which keeps rule-only, patch and other-provider runs working for tests, the container smoke and bench/oss-sample. memoryIo defaults UPTIDE_INTERNAL=1, and tests of the public gate unset it.
  • Docs. README (data table and privacy prose), the privacy statement (help and docs/privacy.md, word for word), SECURITY, fix.md (a new "The Claude Agent SDK" section), models.md (Anthropic only; the patch, reservation and OPENAI_BASE_URL sections are gone), config.md, getting-started, faq, architecture, model-pricing, CONTRIBUTING, and a dated decision in ADR 0016 that supersedes the fallback. uptide init no longer writes executor. The schema keeps the enum so older files still parse. The changeset is minor.

Decisions to flag

  • report.json: the stop happens before the clone, so no run directory exists and no report.json is written. The --json answer and the Action's run report carry the message. If you want a stored stub, tell me where it should live.
  • --pin-current-api (stripe, rule-only, no model call) still runs without a key or the SDK, because no agent is involved.
  • Size is the constant about 300 MB next to SDK_VERSION, measured: 295 MB on linux-x64, about 235 MB on darwin-arm64. It isn't a registry lookup, so the question works before any network call.

Tests

  • packages/cli/src/sdk-required.test.ts covers:
    • TTY yes ('', y, Yes);
    • TTY no (n, no, Ctrl-C): exit 2, nothing cloned, JSON error;
    • non-TTY and --yes: no question, one line;
    • already cached: no question, no download;
    • fetch failure: exit 2, no fallback;
    • the key, provider and uptide.yml stops;
    • hidden flags refused without UPTIDE_INTERNAL=1 and accepted with it.
  • core: fix() stops instead of falling back to patch. Action: executor: patch stops, and SDK_UNAVAILABLE stops the run with the CLI's message.
  • Packed-CLI smoke (Docker, node:22) gained real-path checks: public --no-llm is refused, keyless gives SDK_UNAVAILABLE, and an unreachable npm registry makes the real SDK fetch fail, giving exit 2 with no patch.
  • Local, on the rebased tree: pnpm lint, pnpm typecheck, pnpm build, cli 533/533, core 2307 passed (32 skipped), pnpm docs:links, pnpm smoke all pass.
  • Not covered: the real readline prompt on a real terminal. The question goes through an injected io.ask in tests.

🤖 Generated with Claude Code

lucasbraum and others added 3 commits October 18, 2026 13:27
…, never fall back

uptide fix runs only with the Claude Agent SDK executor; if it can't, it
doesn't run.

- Before the first download, an interactive terminal asks once (default
  yes). --yes or no terminal: downloads and says so in one line. Cached:
  never asks.
- "n", a failed fetch or load, no binary for the platform, no
  ANTHROPIC_API_KEY, another provider, or llm.enabled: false /
  executor: patch in uptide.yml stop fix with exit 2 before any clone or
  spending: one message with the reason and the fix, SDK_UNAVAILABLE in
  --json. No fallback to the patch executor in the CLI, fix() or the
  Action, which stops the run with the same message.
- --no-llm, --agent and --provider are hidden and refused unless
  UPTIDE_INTERNAL=1 (Uptide's own tests). README, privacy, SECURITY,
  fix/models/config docs and ADR 0016 updated; llm.sdkMissing removed;
  uptide init no longer writes executor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…patch stops

Repos onboarded by 0.15.x carry executor: auto (onboarding golden at
v0.15.1), some executor: sdk. Both are the SDK executor with no warning,
in the CLI and the Action; only executor: patch and llm.enabled: false
stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
The SDK gate ran before the Repository phase, so a keyless fix in a bun
repository said "set ANTHROPIC_API_KEY" instead of naming the
unsupported repository, and the invocation smoke lost its Next: line.
The question could also download about 300 MB for a repository fix then
refuses. The gate and the SDK check now run right after the Repository
phase (local reads only): still before any clone, network call or
spending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum merged commit e1e8c40 into main Oct 18, 2026
28 checks passed
@lucasbraum
lucasbraum deleted the lucasbraum/sdk-required branch October 18, 2026 21:21
@uptide-release uptide-release Bot mentioned this pull request Oct 18, 2026
lucasbraum pushed a commit that referenced this pull request Oct 18, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#237](#237)
[`717468a`](717468a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `npx uptide fix`
gets the Agent SDK executor. The package stays as small as before:
`@anthropic-ai/claude-agent-sdk` is not installed with Uptide. An SDK
installed next to Uptide is used as it is; otherwise the first `fix`
that needs it installs the version Uptide is tested with into Uptide's
cache (`~/.cache/uptide/agent-sdk/<version>`), says so in one line with
its size, and later runs reuse it. When that install fails (offline, a
proxy) or the SDK cannot run, `fix` runs the patch executor and says so
on the first line of its output and at the top of the PR body, with the
reason and how to get the SDK executor. `report.json` records
`llm.executor` and, after a fallback, the reason in `llm.sdkMissing`.
The privacy notice names the SDK only when the SDK will run, and the LLM
line names the executor. `--agent sdk` without a usable SDK stops before
any work instead of failing mid-run.

- [#239](#239)
[`e1e8c40`](e1e8c40)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide fix` runs
only with the Claude Agent SDK; if it can't, it doesn't run. Before the
first download, an interactive terminal asks once: `uptide fix needs the
Claude Agent SDK (about 300 MB, downloaded once to <cache>). Download
now? [Y/n]` (default yes). With `--yes`, or without a terminal, it
downloads and says so in one line. Once cached, it never asks again.
Answering `n`, an SDK that can't be fetched or loaded (offline, a proxy,
no binary for the platform), a missing `ANTHROPIC_API_KEY`, another
provider, or `llm.enabled: false` / `executor: patch` in `uptide.yml`
all stop `fix` with exit 2 before any clone or spending. The run prints
one message with the reason and the fix, and `--json` returns it as
`error.code: "SDK_UNAVAILABLE"`. There is no fallback to the patch
executor anywhere: the Uptide Action stops the run with the same
message. `--no-llm`, `--agent` and `--provider` are gone from help and
docs. `llm.sdkMissing` is gone from `report.json`, and `uptide init` no
longer writes `executor`.

### Patch Changes

- [#236](#236)
[`9b35b9d`](9b35b9d)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - A repository
build that fails on the final head is no longer published as a ready PR.
When it fails, `fix` builds the parent commit in the same clone to
compare. If the parent fails too, the build line says "already failing
before this upgrade" and nothing is blocked. If the parent passes, the
upgrade broke the build: verification fails, and the PR opens only as a
draft with "Build broken by this upgrade" at the top. If the parent
can't be checked out, installed or built, verification still fails and
the PR says "Build fails on this upgrade; the parent build could not be
checked" with the reason, never that the parent passed. The GitHub
Action opens these runs as draft PRs, the same way it opens agent-led
runs. The head build also skips workspaces already built on that head,
so a workspace whose output a consumer reads is no longer built twice.

- [#233](#233)
[`1ad8071`](1ad8071)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The PR
description's build check now gives the build's actual result: passed,
failed with its first error, or not run and why. When a migration pack
doesn't require a build, `fix` still runs the repository's build once on
the final head, and `uptide verify` runs it again, and reports what
happened. "Not required by the pack" now appears next to that result
instead of replacing it. Before, the line read "build not required" even
when the repository's build failed. A build the pack doesn't require
still doesn't block verification or publishing.

- [#238](#238)
[`6f07d3f`](6f07d3f)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - An SDK session's
edits are no longer thrown away because of one flaky test. Before the
gate rejects a session on test failures, it runs the failing test files
once more, alone, with their runner and the same isolation as the full
run. A file that passes then is recorded as flaky (`llm.tasks[].flaky`
in `report.json`, and a line in the PR body's review list) and the edits
stay. A file that fails twice still rejects them, and a failure that
names no test file (a build, a timeout) is never rerun. Final
verification keeps its full gate: it runs the flaky files again, and if
one fails there, verification fails and the PR body says so. `fix` also
stops starting verification feedback sessions when what is left of
`--max-cost` is below the mean cost of the run's sessions so far, so it
no longer starts a session it can't afford; the PR's feedback line says
when this happened.

- [#234](#234)
[`066deab`](066deab)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` on npm no
longer loses a package the repo imports without declaring it when the
ERESOLVE retry re-resolves the lockfile. If the retry drops such a
package from the top of `node_modules`, it runs again keeping that
package and the locked packages that require it at their old versions;
if that conflicts, the first retry stands. Either way the summary and
the PR body name the package under "Imported but not declared" and
suggest adding it to package.json. `fix` never adds it for you.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
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.

1 participant