Skip to content

v1.3.296

Choose a tag to compare

@topcheer topcheer released this 27 Nov 10:52
· 7 commits to main since this release

ggcode v1.3.296

Highlights

  • Onboarding can no longer "succeed" without an API key (#5983). Reported from an empty VPS: ggcode → onboarding → DeepSeek → the next start is unusable and every request fails 401 API 密钥无效或未配置. Two misses chained. The wizard's API-key step advanced on Enter with an empty field even for a preset whose api_key is ${DEEPSEEK_API_KEY}, so cmd/ggcode/onboard.go skipped its if result.APIKey != "" branch: nothing in keys.env, the vendor file keeps only the env reference. Then NeedsOnboard() answered "config file exists → no", so onboarding never came back and the only way out was deleting the config. Now the step refuses to advance on an empty key (naming the provider; a vendor key already exported in the environment still satisfies it, which is how systemd / CI installs supply it), onboarding verifies the outcome with config.ActiveEndpointUsable and, when nothing usable was persisted, records onboard_incomplete and prints the three real remedies — persisted-marker NeedsOnboard re-opens the wizard on the next start, and it clears itself as soon as a key shows up. Owner invariant #1865 ("a config file on disk never re-opens onboarding by itself") still holds: only the marker written by a failed onboarding triggers it, and GGCODE_SKIP_AUTOCONFIG / oauth / keyless / loopback endpoints never do.
  • ggcode onboard, and a wizard that fails fast without a TTY (#5983, #5984). #1865 needs an explicit way back, and there was none: ggcode onboard re-runs the wizard (to fix a key or switch provider). Started without an interactive terminal (a non-interactive ssh command, a container exec, a systemd unit) both entry points used to hand control to the tea program and block with no output at all — measured with timeout 10 ggcode onboard </dev/null. They now exit 1 with the provider in effect and the non-interactive alternatives.
  • The headless frontend says it first, instead of 401 later (#5985). The plain path (--plain, TERM=dumb, no TTY) never looked at the credential: it printed its banner and the user learned about it from error: Authentication failed (401). Your API key is invalid or expired... on the first message — the shape most empty-VPS installs take. It now prints the same three-line remediation before the banner. The notice goes to stdout: stderr is discarded in this mode (verified — a Fprintln(os.Stderr, ...) inside RunLinearREPL never reaches the terminal).
  • The browser's Chrome profile is a session resource, not a tool argument (#5981). ~/.ggcode/browser-profiles/ held 8 directories / 1.4 GB after two days on one machine (ggroups, og-check, og-check-2, site, tc-admin-dev, tc-admin-prod, tcshots, system), 90–170 MB each — the baseline cost of a Chrome profile — because profile was a free-form argument and the model invented a name per task, with only the 7-day stale-profile GC ever reclaiming one. The profile is now derived from the call: sess-<sessionID> (persistent per session, reused when the session resumes, shared by its sub-agents through util.EnsureSessionID on the run context; spawns that start from a detached root context pass subagent.RunnerConfig.RootSessionID). shared_profile=true opts into the single shared system profile for logins that should outlive a session. Two layers make the old argument unusable: the dispatch path strips undeclared keys (tool.StripUnknownParams, pinned by #5982) and Execute rejects an explicit profile before any Chrome starts. Docs: docs/guide/environment-variables.md ("Browser profiles").

Fixes and improvements

  • onboard: the swallowed AddVendor error for custom providers is returned, so a failed custom-provider write is reported instead of silently leaving a half-written vendor
  • config: NeedsOnboard judges the active endpoint's usability (key / oauth / keyless / loopback), and its marker branch re-opens the wizard only for a genuinely missing credential — a config whose selection no longer resolves can never nag (#5985)
  • plain: warnPlainFrontendMissingKey + config.ActiveEndpointCredentialMissing keep the notice silent for plaintext keys, loopback endpoints and oauth endpoints
  • release docs: docs/release-process.md now matches the real pipeline — protected main and the admin-bypass / PR alternative, the MAS review-slot semantics (WAITING_FOR_REVIEW does not block a tag; IN_REVIEW does), Release MAS as the main workflow, and the AGENTS.md "Current release" row as the version pointer
  • tests: util (session-id inheritance — a child never overrides the inherited id), tool (profile resolution incl. no-session / shared / rejected argument, Execute refusing before launch, stripUnknownParams over the real browser schema), config (marker semantics, #1865 preserved, save+load round trip), cmd/ggcode (persistOnboardOutcome warning + marker, TTY error text, plain warning trigger/silence), tui (validateAPIKey required / env-provided / keyless / custom). The pre-fix tree fails the empty-key probe (advanced_to_model=true), the fixed tree blocks it with the provider-named error

Upgrade notes

  • browser no longer accepts profile. The Chrome profile is fixed to the ggcode session (sess-<sessionID>) and persists with it; use shared_profile=true for the shared system profile. A stale prompt or skill that still passes profile gets an error naming the fixed profile — drop the argument. Existing profile directories are untouched: they are collected by the stale-profile GC 7 days after their last use (GGCODE_BROWSER_PROFILE_TTL_DAYS), never system.
  • Onboarding: the API-key step is required for providers that need a key, and ggcode onboard re-runs the wizard at any time. An install whose key never reached disk will now be told so, and its next start offers the wizard again (only that marker, never a hand-written config).
  • Headless starts print the missing-key notice before the banner; it disappears once a key is resolvable (environment variable or ~/.ggcode/keys.env).
  • No config changes; the capability table ships unchanged (make sync-model-caps regen still disagrees with the pinned glm-5.4 window, as for the last three releases).

Compare

v1.3.295...v1.3.296