push reports a missing handle when TSCIRCUIT_TOKEN account lookup fails
I maintainer di solito rispondono entro 1 giorno
@cocvn157 ci sta già lavorando.
Dal 8/11/2026.
- #5286 di @danya0003 — chiusa senza merge
- #5366 di @prajwal-0706 — chiusa senza merge
- #5441 di @duongynhi000005-oss — chiusa senza merge
- #5578 di @1932819331hy-debug — chiusa senza merge
- #5641 di @tungnguyen84 — chiusa senza merge
- #5659 di @BrandoBlue — chiusa senza merge
- #5733 di @cocvn157 — aperta
- #5737 di @jeffrey-graham — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- bun, typescript
- Ambito
- authentication, cli
Direzione di ricerca
Start with lib/registry-api/fetch-account.ts and its callers in lib/shared/push-snippet.ts; inspect how lookup failures become null and how push, whoami, login, and initialization handle that result. Review the existing tests for environment-token publishing and expiry guidance, then add coverage for successful lookup, missing handles, HTTP errors, network errors, and malformed responses. Done means lookup failures preserve useful errors and exit nonzero, while a successfully retrieved account without a handle still gets the existing message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
tsci push reports that the user needs to set a tscircuit handle when an authenticated account lookup fails. It discards the underlying HTTP, network or response-parsing error, so a service failure or expired token is presented as missing account metadata.
We encountered this while making and publishing the USB-C rechargeable bicycle brake-light board entirely with tscircuit. The Devesh36 account already had a handle, and we were publishing from the cloud environment using TSCIRCUIT_TOKEN. The network/proxy returned HTTP 503 for the account lookup, but the CLI printed:
You need to set your tscircuit handle to publish packages
Publishing succeeded later when connectivity recovered, without setting a new handle.
Reproduction
The failure can be reproduced without a real token, registry outage or upload. From a CLI repository checkout with dependencies installed, run:
CLI_ENTRY="$PWD/cli/main.ts"
REPRO_DIR=$(mktemp -d)
cd "$REPRO_DIR"
cat > package.json <<'JSON'
{"name":"@tsci/test-user.handle-error-repro","version":"0.0.0"}
JSON
cat > index.circuit.tsx <<'TSX'
export default () => null
TSX
cat > mock-account-503.ts <<'TS'
globalThis.fetch = (async (input: Request | URL | string) => {
const url = typeof input === "string" || input instanceof URL
? String(input) : input.url
if (new URL(url).pathname === "/accounts/get") {
return Response.json(
{ error: { error_code: "service_unavailable", message: "Simulated outage" } },
{ status: 503 },
)
}
throw new Error("Unexpected request blocked by reproduction")
}) as typeof fetch
TS
TSCIRCUIT_TOKEN=placeholder-token \
TSCIRCUIT_CONFIG_DIR="$REPRO_DIR/.config" \
bun --preload ./mock-account-503.ts "$CLI_ENTRY" push index.circuit.tsx
Actual: missing-handle message, exit code 1. Only /accounts/get is attempted; no upload occurs.
Expected: an account-verification failure that preserves the service error, for example:
Could not verify your account for publishing: registry returned HTTP 503.
Retry when the registry is available.
The missing-handle message should apply only after successfully retrieving an account that actually lacks a handle.
Cause
When TSCIRCUIT_TOKEN is set, push-snippet.ts gets the publishing handle through fetchAccount().
fetch-account.ts catches every request/parsing exception and returns null. The caller then treats the absent handle as proof that the user must set one. This also swallows the HTTP client's existing expired-session guidance.
The environment-token publishing path was introduced in #5131. The saved-session path reads the cached handle directly and does not make this account lookup at that step.
Additional verification
We exercised 17 controlled CLI scenarios with placeholder tokens and intercepted requests. These all incorrectly produced the same missing-handle message:
- HTTP 503, 401 with
session_expired, 403 and 429; - connection failure and an injected timeout exception;
- HTTP 200 with malformed JSON or a missing account object;
- HTTP 503 even when a valid handle was already saved alongside the environment token.
A valid account with a handle passed account validation. A valid account without a handle correctly produced the existing message. No-token input correctly requested login. The success controls were stopped before any release lookup or publication, and all project manifests remained unchanged.
The shared helper also makes auth whoami print @(not set) and exit 0 after account lookup fails, and login can print Already logged in as @undefined! when no saved handle is available.
Suggested fix and regression coverage
Distinguish failed lookup from a successfully retrieved account with no handle, and report lookup failures with a nonzero exit code. Preserve useful authentication/status information. Do not fall back to a cached handle for an environment-token failure, since that token may identify another account.
Update affected callers of fetchAccount deliberately: push, whoami, login, and initialization's optional author lookup. Tests should cover a successful lookup, a genuinely missing handle, HTTP 503, expired token, network error and malformed response. Existing tests cover successful environment-token publishing and lower-level expiry messages but miss this swallowed-error path.
Environment
- Observed and reproduced with
[email protected],@tscircuit/[email protected], Bun 1.4.0. - The same implementation remains in reviewed upstream CLI 0.1.2294, commit
3945316bf27f9ff4ba2b16a1683b9c2810446f82.
- Lingua principale
- TypeScript
- Stelle
- 19
- Fork
- 115
- Merge medio
- 1h 50m
- PR unite (30g)
- 260
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tscircuit/cli
-
`tsci check` and `tsci check netlist` exit 0 when they report errorsForse già presa @aswadi l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 57/100
I maintainer di solito rispondono entro 1 giorno
-
@tscircuit/cli 0.1.2452 bundles brace-expansion 2.0.1 and minimatch 5.1.2 (via make-vfs), both with published advisoriesForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
tsci dev: ngspice spiceEngine from tscircuit.config.ts fails three ways (package.json, top-level await, blob import)Forse già presa @cocvn157 l’ha presa 12 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
-
tsci export -f glb can't load a relative cadModel stepUrl (404); build --glbs canForse già presa @jeffrey-graham l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
The CLI needs Bun: under Node alone `tsci` fails and the Node entry can't load `.tsx`Forse già presa @cocvn157 l’ha presa 9 giorni fa. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 35/100
tscircuit/cli#5449 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tscircuit/cli
Issue simili
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
midnightntwrk/platform-js#38 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ranxianglei/billion-context#7068 ·
I maintainer di solito rispondono entro 1 giorno
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ilan-pinto/roaring-lions#1552 ·
I maintainer di solito rispondono entro 1 giorno