Files

75 lines
2.3 KiB
Nix

{ config, ... }:
{
xdg.configFile."opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
provider = {
openrouter = {
models = {
"openrouter/openai/gpt-oss-120b" = {
options = {
provider = {
order = [ "groq" "cerebras" ];
allow_fallbacks = true;
};
};
};
"openrouter/moonshotai/kimi-k2.5" = {
options = {
provider = {
order = [ "Nitro" ];
allow_fallbacks = true;
};
};
};
};
};
};
agent = {
commit = {
description = "Creates a one-line git commit describing the changes";
mode = "primary";
model = "openrouter/openai/gpt-oss-120b";
prompt = ''
You are a git commit agent. When invoked:
1. Run `git status` and `git diff` to understand all changes
2. Stage appropriate files with `git add`
3. Create a single one-line commit message that clearly describes the changes
4. Never push to remote
5. Never use --no-verify or --force flags
'';
permission = {
bash = {
"git *" = "allow";
};
edit = "allow";
};
};
compact = {
description = "Compacts and summarizes conversation context to reduce token usage";
mode = "primary";
model = "openrouter/openai/gpt-oss-120b";
prompt = ''
You are a context compaction specialist. Your job is to summarize and compress the conversation history while preserving:
1. Key decisions and their rationale
2. Important code changes and their purposes
3. Unresolved issues or TODOs
4. File paths and line references that are still relevant
Be extremely concise. Remove:
- Redundant explanations
- Already-applied code diffs
- Exploration steps that didn't lead anywhere
- Verbose tool outputs
Output a dense, information-rich summary that captures the essential state of the conversation.
'';
permission = {
edit = "deny";
bash = { "*" = "deny"; };
};
};
};
};
}