sipeed/picoclaw · error

could not update config

Error message

could not update config: %w

What it means

Context wrapper in authLoginOpenAI around config.SaveConfig: login and credential storage both succeeded, but updating picoclaw's main config (adding/keeping the openai model entry and setting the default model) failed. Authentication is saved; only the config-file convenience update was lost, so the default model may be stale.

Solutions

  1. Check write permission on the config file returned by GetConfigPath
  2. Repair malformed config file syntax that may block saving
  3. Set the default model manually in the config file if login already succeeded
  4. Re-run login after fixing the file — credentials already stored may make it idempotent
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/picoclaw/internal/auth/helpers.go:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/6aecad6efeb8ec44. Report an issue: GitHub.

Appendix: source

Thrown at cmd/picoclaw/internal/auth/helpers.go:82

				foundOpenAI = true
				break
			}
		}

		// If no openai in ModelList, add it
		if !foundOpenAI {
			appCfg.ModelList = append(appCfg.ModelList, &config.ModelConfig{
				ModelName:  "gpt-5.4",
				Model:      "openai/gpt-5.4",
				AuthMethod: "oauth",
			})
		}

		// Update default model to use OpenAI
		appCfg.Agents.Defaults.ModelName = "gpt-5.4"

		if err = config.SaveConfig(internal.GetConfigPath(), appCfg); err != nil {
			return fmt.Errorf("could not update config: %w", err)
		}
	}

	fmt.Println("Login successful!")
	if cred.AccountID != "" {
		fmt.Printf("Account: %s\n", cred.AccountID)
	}
	fmt.Println("Default model set to: gpt-5.4")

	return nil
}

func authLoginGoogleAntigravity(noBrowser bool) error {
	cfg := auth.GoogleAntigravityOAuthConfig()

	cred, err := auth.LoginBrowserWithOptions(cfg, auth.LoginBrowserOptions{NoBrowser: noBrowser})
	if err != nil {
		return fmt.Errorf("login failed: %w", err)

View on GitHub (pinned to 49183d7e8d)