Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ OPENCLAW_ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
OPENCLAW_GATEWAY_TOKEN=your-gateway-token-here
# OpenCode API key for OpenCode Go access via cliproxyapi
OPENCODE_API_KEY=your-opencode-api-key-here
# xAI API key for Grok access via x.ai subscription (used by opencode xai provider)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium

Good documentation of the new API key. However, since xai/grok-4.5 is now the default model, consider adding additional context here explaining: (1) this key is required for the default configuration, (2) how to obtain it (link to x.ai subscription), and (3) what fallback model to use if unavailable. This will significantly improve developer onboarding and reduce setup friction.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#2030
File: .env.example#L16
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
Good documentation of the new API key. However, since `xai/grok-4.5` is now the default model, consider adding additional context here explaining: (1) this key is **required** for the default configuration, (2) how to obtain it (link to x.ai subscription), and (3) what fallback model to use if unavailable. This will significantly improve developer onboarding and reduce setup friction.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The comment says "via x.ai subscription" but XAI_API_KEY is actually for pay-as-you-go API access through the xAI Console (console.x.ai). xAI subscriptions (SuperGrok / X Premium) authenticate via OAuth, not API keys. This will confuse developers trying to set up their environment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .env.example, line 16:

<comment>The comment says "via x.ai subscription" but `XAI_API_KEY` is actually for pay-as-you-go API access through the xAI Console (`console.x.ai`). xAI subscriptions (SuperGrok / X Premium) authenticate via OAuth, not API keys. This will confuse developers trying to set up their environment.</comment>

<file context>
@@ -13,5 +13,7 @@ OPENCLAW_ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
 OPENCLAW_GATEWAY_TOKEN=your-gateway-token-here
 # OpenCode API key for OpenCode Go access via cliproxyapi
 OPENCODE_API_KEY=your-opencode-api-key-here
+# xAI API key for Grok access via x.ai subscription (used by opencode xai provider)
+XAI_API_KEY=xai-your-key-here
 # Paperclip database URL
</file context>
Suggested change
# xAI API key for Grok access via x.ai subscription (used by opencode xai provider)
# xAI API key for Grok access via xAI Console (used by opencode xai provider)

XAI_API_KEY=xai-your-key-here
Comment on lines +16 to +17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment states that the XAI_API_KEY is for access via the "x.ai subscription". However, xAI subscriptions (SuperGrok / X Premium) authenticate via OAuth (browser login or device code) and do not provide API keys. The XAI_API_KEY is instead used for pay-as-you-go API access via the xAI Console (console.x.ai). The comment should be updated to avoid confusing users.

# xAI API key for Grok access via xAI Console (used by opencode xai provider)
XAI_API_KEY=xai-your-key-here

# Paperclip database URL
DATABASE_URL=postgres://user:password@host:5432/paperclip
13 changes: 12 additions & 1 deletion config/opencode/opencode.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "cliproxyapi/glm-4.7",
"model": "xai/grok-4.5",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High

Changing the default model to xai/grok-4.5 creates a breaking change for environments without XAI_API_KEY. Fresh setups, CI pipelines, and new developer environments will fail immediately. Consider: (1) adding preflight validation with actionable error messages pointing to .env.example, (2) implementing fallback logic to cliproxyapi/glm-4.7 when the key is unavailable, or (3) keeping a widely-available provider as default and documenting Grok as an opt-in upgrade.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#2030
File: config/opencode/opencode.jsonc#L3
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
Changing the default model to `xai/grok-4.5` creates a breaking change for environments without `XAI_API_KEY`. Fresh setups, CI pipelines, and new developer environments will fail immediately. Consider: (1) adding preflight validation with actionable error messages pointing to `.env.example`, (2) implementing fallback logic to `cliproxyapi/glm-4.7` when the key is unavailable, or (3) keeping a widely-available provider as default and documenting Grok as an opt-in upgrade.

"small_model": "cliproxyapi/glm-4.7",
"autoupdate": true,
"agent": {
Expand Down Expand Up @@ -193,6 +193,17 @@
}
}
},
"xai": {
"name": "xAI",
"options": {
"apiKey": "{env:XAI_API_KEY}"
},
"models": {
"grok-4.5": {
"name": "Grok 4.5 (via xAI subscription)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The display name "Grok 4.5 (via xAI subscription)" is misleading — XAI_API_KEY is used for pay-as-you-go access through the xAI Console, not subscription-based OAuth. Consider renaming to "Grok 4.5 (via xAI API)" to accurately reflect the authentication method.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At config/opencode/opencode.jsonc, line 203:

<comment>The display name "Grok 4.5 (via xAI subscription)" is misleading — `XAI_API_KEY` is used for pay-as-you-go access through the xAI Console, not subscription-based OAuth. Consider renaming to "Grok 4.5 (via xAI API)" to accurately reflect the authentication method.</comment>

<file context>
@@ -193,6 +193,17 @@
+      },
+      "models": {
+        "grok-4.5": {
+          "name": "Grok 4.5 (via xAI subscription)"
+        }
+      }
</file context>
Suggested change
"name": "Grok 4.5 (via xAI subscription)"
"name": "Grok 4.5 (via xAI API)"

}
Comment on lines +202 to +204

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The display name says "via xAI subscription", but this provider block is configured to use XAI_API_KEY which is for the pay-as-you-go xAI Console API. Users with a SuperGrok subscription authenticate via OAuth and do not use this API key. To prevent confusion, the display name should be updated to "via xAI API" or "via xAI Console".

        "grok-4.5": {
          "name": "Grok 4.5 (via xAI API)"
        }

}
},
"zai-coding-plan": {
"models": {
"glm-4.7": {
Expand Down
13 changes: 12 additions & 1 deletion config/opencode/opencode.tpl.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
"model": "cliproxyapi/__GLM__",
"model": "xai/__GROK__",
"small_model": "cliproxyapi/__GLM__",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: the default model is now xai/__GROK__, but small_model still resolves to cliproxyapi/__GLM__. Anyone who onboards with just XAI_API_KEY (as .env.example now suggests) will get auth failures the moment opencode dispatches to the small-model path. If keeping GLM here is intentional (cheaper/faster for aux calls), no action needed — otherwise switch this to xai/__GROK__ so the default stack is self-consistent.

"autoupdate": true,
"agent": {
Expand Down Expand Up @@ -193,6 +193,17 @@
}
}
},
"xai": {
"name": "xAI",
"options": {
"apiKey": "{env:XAI_API_KEY}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium

The apiKey configuration uses environment variable interpolation {env:XAI_API_KEY}. Please verify this interpolation format matches the pattern used by other providers (e.g., anthropic, openai) to ensure consistency in credential resolution. If other providers use a different format or include additional options like timeout/retry/baseUrl fields, those should be added here for parity.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#2030
File: config/opencode/opencode.tpl.jsonc#L199
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
The `apiKey` configuration uses environment variable interpolation `{env:XAI_API_KEY}`. Please verify this interpolation format matches the pattern used by other providers (e.g., anthropic, openai) to ensure consistency in credential resolution. If other providers use a different format or include additional options like timeout/retry/baseUrl fields, those should be added here for parity.

},
"models": {
"__GROK__": {
"name": "__GROK_PRETTY__ (via xAI subscription)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Same issue as in the generated config: "via xAI subscription" is inaccurate for API-key-based access. This template propagates the misleading label. Should be "via xAI API" to match how XAI_API_KEY authentication actually works.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At config/opencode/opencode.tpl.jsonc, line 203:

<comment>Same issue as in the generated config: "via xAI subscription" is inaccurate for API-key-based access. This template propagates the misleading label. Should be "via xAI API" to match how `XAI_API_KEY` authentication actually works.</comment>

<file context>
@@ -193,6 +193,17 @@
+      },
+      "models": {
+        "__GROK__": {
+          "name": "__GROK_PRETTY__ (via xAI subscription)"
+        }
+      }
</file context>
Suggested change
"name": "__GROK_PRETTY__ (via xAI subscription)"
"name": "__GROK_PRETTY__ (via xAI API)"

}
Comment on lines +202 to +204

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The display name in the template says "via xAI subscription", but this provider block is configured to use XAI_API_KEY which is for the pay-as-you-go xAI Console API. Users with a SuperGrok subscription authenticate via OAuth and do not use this API key. To prevent confusion, the display name should be updated to "via xAI API" or "via xAI Console".

        "__GROK__": {
          "name": "__GROK_PRETTY__ (via xAI API)"
        }

}
},
"zai-coding-plan": {
"models": {
"glm-4.7": {
Expand Down
1 change: 1 addition & 0 deletions models.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"gpt-nano": "gpt-5.4-nano",
"gemini-pro": "gemini-3.1-pro-preview",
"gemini-flash": "gemini-3.1-flash-preview",
"grok": "grok-4.5",
"glm": "glm-4.7",
"minimax": "minimax-m2.7",
"gemma": "gemma-4-27b-it",
Expand Down
Loading