{"record":{"id":"c6964ee195d6162d","repo":"multica-ai/multica","slug":"get-agent-env-w","errorCode":null,"errorMessage":"get agent env: %w","messagePattern":"get agent env: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1133,"sourceCode":"// Agent env subcommands\n// ---------------------------------------------------------------------------\n\n// runAgentEnvGet fetches the plaintext custom_env for a single agent\n// via the audited `/env` endpoint. The CLI prints raw JSON in JSON\n// mode and a key/value table otherwise; we never truncate or mask\n// values here — the security gate is on the server, not the printer.\nfunc runAgentEnvGet(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar resp map[string]any\n\tif err := client.GetJSON(ctx, \"/api/agents/\"+args[0]+\"/env\", &resp); err != nil {\n\t\treturn fmt.Errorf(\"get agent env: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, resp)\n\t}\n\n\theaders := []string{\"KEY\", \"VALUE\"}\n\tenv, _ := resp[\"custom_env\"].(map[string]any)\n\trows := make([][]string, 0, len(env))\n\tfor k, v := range env {\n\t\trows = append(rows, []string{k, fmt.Sprintf(\"%v\", v)})\n\t}\n\tcli.PrintTable(os.Stdout, headers, rows)\n\treturn nil\n}\n\n// runAgentEnvSet replaces an agent's custom_env wholesale via the","sourceCodeStart":1115,"sourceCodeEnd":1151,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1115-L1151","documentation":"Error \"get agent env: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_agent.go:1133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check server connectivity and permissions, then retry fetching the agent env."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}