Add agent configuration templates - #1
Conversation
e256461 to
b458fa4
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds starter configuration templates for three agent tools (OpenCode, Codex, and Claude Code) so contributors can more easily set up a consistent custom-provider workflow without committing secrets.
Changes:
- Added an OpenCode config with an OpenAI-compatible provider and a curated model/variant matrix.
- Added a Codex
config.tomlfor a custom model provider plus approval/notification hooks. - Added a Claude Code
settings.jsonwith environment and hook defaults for the same provider setup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| opencode/opencode.json | OpenCode provider + models/variants template for an OpenAI-compatible backend. |
| codex/config.toml | Codex custom provider template plus approval reviewer and hook commands. |
| claude/settings.json | Claude Code settings template with env defaults and approval/stop hooks. |
Suppressed comments (4)
codex/config.toml:27
- Same as above: this hook appends to
/tmp/codex-bark-hook.logand may grow unbounded. Redirect to/dev/null(or make logging opt-in) to keep the template safe by default.
type = "command"
command = "zsh -lc 'host=\"${HOST:-$(hostname)}\"; bark -t \"Codex @ ${host}\" -b \"本轮 Codex 回复已结束\" -i \"https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.88.0/light/codex-color.png\" -g \"codex\" -l \"active\" >> /tmp/codex-bark-hook.log 2>&1 || true'"
timeout = 5
claude/settings.json:9
- Use a reserved example domain (e.g.
api.example.com) for templates.api.example.topis not a reserved example domain and could be real, leading to accidental outbound calls if users forget to change it.
"ANTHROPIC_BASE_URL": "https://api.example.top",
claude/settings.json:19
BARK_DEVICE_KEYSis set to an empty string. If Claude Code applies these env entries literally, this can override a valid value from the shell and break notifications in a non-obvious way. Prefer removing the key or using a non-empty placeholder.
"BARK_DEVICE_KEYS": "",
claude/settings.json:20
- Use a reserved example domain (e.g.
bark.example.com) for templates.bark.example.topis not reserved and could be real; usingexample.comhelps prevent accidental network calls from unedited templates.
"BARK_SERVER": "https://bark.example.top/push",
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "options": { | ||
| "apiKey": "", | ||
| "baseURL": "https://api.example.top/v1", | ||
| "setCacheKey": true | ||
| }, |
| requires_openai_auth = true | ||
| base_url = "https://api.example.top/v1" | ||
| experimental_bearer_token = "" |
| type = "command" | ||
| command = "zsh -lc 'host=\"${HOST:-$(hostname)}\"; bark -t \"Codex @ ${host}\" -b \"需要你审批 Codex 的工具调用\" -i \"https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.88.0/light/codex-color.png\" -g \"codex\" -l \"timeSensitive\" >> /tmp/codex-bark-hook.log 2>&1 || true'" | ||
| timeout = 5 |
| }, | ||
| "effortLevel": "high", | ||
| "env": { | ||
| "ANTHROPIC_AUTH_TOKEN": "", |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b458fa4815
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "effortLevel": "high", | ||
| "env": { | ||
| "ANTHROPIC_AUTH_TOKEN": "", | ||
| "ANTHROPIC_BASE_URL": "https://api.example.top", |
There was a problem hiding this comment.
Use a reserved domain for placeholder endpoints
When a user fills in the blank ANTHROPIC_AUTH_TOKEN but leaves this apparent placeholder unchanged, Claude Code will send the token and conversation data to api.example.top. The .top TLD is publicly registrable, and example.top is not an IANA-reserved documentation domain; the same unsafe API placeholder is used in codex/config.toml:12 and opencode/opencode.json:8, while the Bark endpoint has the same problem. Use a guaranteed non-claimable name such as api.example.com or a .example domain so activating a template cannot disclose credentials to whoever controls the hostname.
Useful? React with 👍 / 👎.
Adds validated, redacted configuration templates for Codex, Claude Code, and OpenCode.
No credentials or personal/internal endpoint URLs are included.