{"record":{"id":"1fc08baae4599797","repo":"sipeed/picoclaw","slug":"no-models-available","errorCode":null,"errorMessage":"no models available","messagePattern":"no models available","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/picoclaw/internal/auth/helpers.go","lineNumber":467,"sourceCode":"\t\t\tcred = refreshed\n\t\t\t_ = auth.SetCredential(\"google-antigravity\", cred)\n\t\t}\n\t}\n\n\tprojectID := cred.ProjectID\n\tif projectID == \"\" {\n\t\treturn fmt.Errorf(\"no project id stored. Try logging in again\")\n\t}\n\n\tfmt.Printf(\"Fetching models for project: %s\\n\\n\", projectID)\n\n\tmodels, err := providers.FetchAntigravityModels(cred.AccessToken, projectID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error fetching models: %w\", err)\n\t}\n\n\tif len(models) == 0 {\n\t\treturn fmt.Errorf(\"no models available\")\n\t}\n\n\tfmt.Println(\"Available Antigravity Models:\")\n\tfmt.Println(\"-----------------------------\")\n\tfor _, m := range models {\n\t\tstatus := \"✓\"\n\t\tif m.IsExhausted {\n\t\t\tstatus = \"✗ (quota exhausted)\"\n\t\t}\n\t\tname := m.ID\n\t\tif m.DisplayName != \"\" {\n\t\t\tname = fmt.Sprintf(\"%s (%s)\", m.ID, m.DisplayName)\n\t\t}\n\t\tfmt.Printf(\"  %s %s\\n\", status, name)\n\t}\n\n\treturn nil\n}","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/auth/helpers.go#L449-L485","documentation":"Guard in the Antigravity models listing helper that fires when FetchAntigravityModels succeeds but returns a zero-length slice. Notably, the current implementation always appends gemini-3-flash-preview and gemini-3-flash when absent (antigravity_provider.go:621-632), so with the present code this branch is effectively unreachable unless the fallback-append logic is removed or the upstream models map is empty and the hardcoding is dropped.","triggerScenarios":"The fetchAvailableModels response contains an empty/missing models map AND the hardcoded gemini-3-flash fallback entries are removed in a future version; a mocked/stubbed provider in tests returns an empty slice; upstream changes the payload shape so the models field decodes as empty without a JSON error.","commonSituations":"Custom forks that strip the fallback model entries; tests injecting empty model lists; an upstream API response format change that yields zero parsed models.","solutions":["Treat as expected output, not a crash: report that no models are provisioned for this project","Verify the project ID used has Antigravity/Code Assist enabled in the cloud console","Re-login to refresh credentials and retry the fetch","If maintaining a fork that removed the gemini-3-flash fallback, restore it or relax this guard"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(models) == 0 {\n\tfmt.Println(\"no models provisioned for this project — nothing to list\")\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm Antigravity/Code Assist is enabled for the cloud project before listing","In tests, stub FetchAntigravityModels to return at least one AntigravityModelInfo"],"tags":["go","antigravity","models","validation"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}