chore(fork): sync current upstream before Claude recovery - #5
Closed
q1 wants to merge 320 commits into
Closed
Conversation
…9938) Co-authored-by: Claude Code <noreply@anthropic.com>
Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`fork.json` `prism.usageSource` (default true) says whether Prism publishes its pooled accounts to the Limits view through upstream's usage-limit source machinery. `PrismStatus.usageSource` reports it and `PUT /api/fork/prism/usage-source` (`access:write`) changes it, with the matching `setPrismUsageSource` client function. Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Upstream now polls "CLIProxyAPI hub" entries from settings.usageLimitSources and shows their pooled accounts on Usage -> Limits. Prism already knows its gateway URL and management secret, so with the flag on it should be one of those sources without the user re-entering it as a hub. The process-wide PrismEndpoint now carries the management secret (server only) and the prism.usageSource toggle. PrismEnvironment derives the `prism` cliproxy entry from it, appends it to the configured sources unless a user hub already targets the same origin (or reuses the id), and emits on a PubSub whenever the entry appears, moves, or disappears. UsageLimitSources gets three marked seam lines: the import, the wrapped entries, and a refresh subscription. With the flag off the helper returns the same array instance, so the upstream path is unchanged. PrismService publishes the secret and toggle with the endpoint, reports `usageSource` in its status, and gains `reloadUsageSource`, which the new `PUT usage-source` handler calls after writing prism.usageSource through ForkFlagsService.update (503 flag-off, 403 without access:write, 500 on a failed write). Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With the server publishing Prism as a usage-limit source, the web app has to say so where upstream shows hubs, without asking the user to add the proxy as a hub by hand. Settings -> Providers -> Usage providers renders a fork-owned Prism row first when that environment's prism flag is on: "Managed by q1code", the base URL, and whether the pooled accounts reach Usage -> Limits, with a link to the Prism tab. It is not removable there; the empty-state row yields to it and renders upstream's text otherwise. Usage -> Limits labels the source with id `prism` as "Prism" instead of "CLI Proxy". Both are three-line marked seams. The Prism tab's Status section gains the switch "Show pooled accounts on Usage -> Limits" bound to setPrismUsageSource (optimistic, rolls back with a toast on failure) with a line linking to /usage. The tab's own API-key usage section and the per-account quota tooltip are gone: the Limits view owns quota now. The "Requests" counters stay. getPrismUsage stays in the client runtime for the CLI. Search entry prism-usage-source, "Show on Usage -> Limits". usePrismApi can bind to any environment for the row. Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The registry entry for prism gains the phase 4 summary (behaviour, the prism.usageSource toggle, the same-origin dedupe rule, flag-off parity, the tests), the config key, and the three new seam files. fork/SEAMS.md is regenerated: 39 of 40 files. Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Mic's fleet monitor needs one command that answers "is this host's Prism
gateway up, and how many accounts does it pool" without a running server.
`q1code prism status --json` reads fork.json and the secret store from the
state directory, resolves the gateway like PrismService does (sidecar
loopback port or the external origin, default or configured management
secret name), probes /v0/management/latest-version with a 5 s timeout, then
counts /auth-files and reads /routing/strategy. It prints exactly
{mode, baseUrl, reachable, accounts, disabled, strategy, error?} and exits 0
only when the flag is on, the secret is stored, and every call answered;
otherwise it still prints the object with `error` (never the secret) and
exits 1. `prism accounts [--json]` lists id, provider, disabled, weight.
The HTTP layer is a reference (Fetch by default) so the tests drive the
whole CLI over a scripted client and TestClock. `runWithSecretStore` is
exported from secret.ts and its callback may use Path. bin.ts gains one
`// fork: prism` seam line (import plus subcommand entry) next to the
`base` one.
Fork-Feature: prism
Upstream: no
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Limits view can show Prism's pooled accounts, and the server exposes that as `PrismStatus.usageSource` with `PUT usage-source`. Mobile had no way to see or change it. The Status section now carries a "Show pooled accounts on Usage → Limits" switch. It reads `status.usageSource` (absent means on), flips at once, ignores a stale status poll while the save is in flight, and rolls back with an inline error when `setPrismUsageSource` fails. The state machine is the pure `reducePrismUsageSource` in prismSettings.logic.ts with tests; usePrismApi binds `setUsageSource`. Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Registry entry for prism: the `q1code prism status|accounts` bullet (exit codes, JSON keys, no server needed), the bin.ts seam in the seams list, the mobile switch sentence, and the new CLI test file plus the usage-source reducer cases in the tests list. Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… summary Fork-Feature: prism Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he sync The rebase resolution of the release-manifest commit left the workspace dependency listed under both dependencies and devDependencies; pnpm then rewrote the lockfile on every install. Back to the single devDependency entry the pack step relies on. Fork-Feature: base Upstream: no Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fork-Feature: base Upstream: no
Verified the Linux amd64 release against checksums.txt and exercised its authenticated management API with isolated temporary state. Fork-Feature: prism Upstream: no
Use authenticated routing state for readiness and reuse that response in CLI status. A failed GitHub version check no longer marks a working gateway unavailable. Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: prism Upstream: no
Fork-Feature: base Upstream: no
Fork-Feature: base Upstream: no
q1
force-pushed
the
sync/20260906T212712Z
branch
from
September 6, 2026 22:09
0b4924a to
db595e1
Compare
q1
pushed a commit
that referenced
this pull request
Sep 8, 2026
Retain the manual fix reviewed in sync PR #5: the app also defines an Environment model, so qualify the SwiftUI property wrapper explicitly. The Prism feature expansion had restored the unqualified spelling. Fork-Feature: prism Fork-Feature: swift-ios Upstream: no
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase the maintained series from upstream
2fb99a7a6ontoea646c083before the Claude failed-turn recovery work. Themainmirror is updated; this PR does not promoteforkor deploy a release.All 86 existing commits were replayed. Manual resolutions preserve the current dependency patch hash, private CLI helper and branded command suggestions, npm/pnpm installation fallback with verified release tarballs, and both Projects and Prism routes. Upstream's pooled usage view now reads source labels directly, so the obsolete Prism label override was removed. The Prism adapter now forwards the new compaction descriptor. SwiftUI's Environment property wrapper is qualified to avoid the connection-model name collision.
Validation:
This sync required manual resolutions, so it is left for human review under the fork-sync policy. Rollback tag:
snap/20260906T212712Z. The detailed sync log isfork/docs/sync-log/20260906T212712Z.md.Model: GPT-6. Harness: Codex.