-
Notifications
You must be signed in to change notification settings - Fork 67
fix(debate/consult): add External Tool Quick Reference, update provider model names (#232) #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e179b2d
e53a656
4ba9bae
102bcc3
8ae8026
8c4f655
a35eb75
3d4f962
da93f5a
6238094
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,10 +23,13 @@ const codexSkillPath = path.join(adaptersDir, 'codex', 'skills', 'debate', 'SKIL | |||||
| const openCodeCommandPath = path.join(adaptersDir, 'opencode', 'commands', 'debate.md'); | ||||||
| const openCodeSkillPath = path.join(adaptersDir, 'opencode', 'skills', 'debate', 'SKILL.md'); | ||||||
| const openCodeAgentPath = path.join(adaptersDir, 'opencode', 'agents', 'debate-orchestrator.md'); | ||||||
| const openCodeConsultSkillPath = path.join(adaptersDir, 'opencode', 'skills', 'consult', 'SKILL.md'); | ||||||
| const consultSkillPath = path.join(__dirname, '..', 'plugins', 'consult', 'skills', 'consult', 'SKILL.md'); | ||||||
|
|
||||||
| // Load all files once | ||||||
| let commandContent, skillContent, agentContent, pluginJson; | ||||||
| let codexSkillContent, openCodeCommandContent, openCodeSkillContent, openCodeAgentContent; | ||||||
| let openCodeConsultSkillContent, consultSkillContent; | ||||||
|
|
||||||
| beforeAll(() => { | ||||||
| commandContent = fs.readFileSync(commandPath, 'utf8'); | ||||||
|
|
@@ -37,6 +40,8 @@ beforeAll(() => { | |||||
| openCodeCommandContent = fs.readFileSync(openCodeCommandPath, 'utf8'); | ||||||
| openCodeSkillContent = fs.readFileSync(openCodeSkillPath, 'utf8'); | ||||||
| openCodeAgentContent = fs.readFileSync(openCodeAgentPath, 'utf8'); | ||||||
| openCodeConsultSkillContent = fs.readFileSync(openCodeConsultSkillPath, 'utf8'); | ||||||
| consultSkillContent = fs.readFileSync(consultSkillPath, 'utf8'); | ||||||
| }); | ||||||
|
|
||||||
| // ─── Helpers ──────────────────────────────────────────────────────── | ||||||
|
|
@@ -650,3 +655,83 @@ describe('adapter consistency', () => { | |||||
| expect(openCodeAgentContent).toMatch(/240.second timeout|Track invocation start time/i); | ||||||
| }); | ||||||
| }); | ||||||
|
|
||||||
| // ─── 14. External Tool Quick Reference (#232) ──────────────────── | ||||||
| describe('external tool quick reference (#232)', () => { | ||||||
| // Use pre-loaded content (no redundant file reads) | ||||||
| const allDebateSkillContents = () => [skillContent, openCodeSkillContent, codexSkillContent]; | ||||||
|
|
||||||
| test('all three debate skill copies contain the External Tool Quick Reference section', () => { | ||||||
| for (const content of allDebateSkillContents()) { | ||||||
| expect(content).toContain('## External Tool Quick Reference'); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('all five providers mentioned in quick reference of each skill copy', () => { | ||||||
| for (const content of allDebateSkillContents()) { | ||||||
| expect(content).toMatch(/External Tool Quick Reference[\s\S]*claude/i); | ||||||
| expect(content).toMatch(/External Tool Quick Reference[\s\S]*gemini/i); | ||||||
| expect(content).toMatch(/External Tool Quick Reference[\s\S]*codex/i); | ||||||
| expect(content).toMatch(/External Tool Quick Reference[\s\S]*opencode/i); | ||||||
| expect(content).toMatch(/External Tool Quick Reference[\s\S]*copilot/i); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('effort-to-model mapping table present in each skill copy', () => { | ||||||
| for (const content of allDebateSkillContents()) { | ||||||
| expect(content).toContain('Effort-to-Model Mapping'); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('output parsing table present in each skill copy', () => { | ||||||
| for (const content of allDebateSkillContents()) { | ||||||
| expect(content).toContain('Output Parsing'); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('canonical source note present in each skill copy', () => { | ||||||
| for (const content of allDebateSkillContents()) { | ||||||
| expect(content).toMatch(/canonical source.*consult/i); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('current model names present in effort-to-model mapping of each skill copy', () => { | ||||||
| const expectedModels = ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-6', 'o4-mini', 'o3', 'gemini-2.5-flash']; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| for (const content of allDebateSkillContents()) { | ||||||
| for (const model of expectedModels) { | ||||||
| expect(content).toMatch(new RegExp(`Effort-to-Model Mapping[\\s\\S]*${model}`)); | ||||||
| } | ||||||
| } | ||||||
| }); | ||||||
| }); | ||||||
|
|
||||||
| // ─── 15. Consult skill adapter sync (#232) ─────────────────────── | ||||||
| describe('consult skill opencode adapter sync (#232)', () => { | ||||||
| test('opencode consult adapter contains all 5 providers', () => { | ||||||
| for (const provider of ['claude', 'gemini', 'codex', 'opencode', 'copilot']) { | ||||||
| expect(openCodeConsultSkillContent.toLowerCase()).toContain(provider); | ||||||
| } | ||||||
| }); | ||||||
|
|
||||||
| test('opencode consult adapter has updated claude model names', () => { | ||||||
| expect(openCodeConsultSkillContent).toContain('claude-haiku-4-5'); | ||||||
| expect(openCodeConsultSkillContent).toContain('claude-sonnet-4-6'); | ||||||
| expect(openCodeConsultSkillContent).toContain('claude-opus-4-6'); | ||||||
| }); | ||||||
|
|
||||||
| test('opencode consult adapter has updated codex model names (no speculative gpt-5.x)', () => { | ||||||
| expect(openCodeConsultSkillContent).not.toContain('gpt-5.3-codex'); | ||||||
| expect(openCodeConsultSkillContent).not.toContain('gpt-5.2-codex'); | ||||||
| expect(openCodeConsultSkillContent).toContain('o4-mini'); | ||||||
| expect(openCodeConsultSkillContent).toContain('o3'); | ||||||
| }); | ||||||
|
|
||||||
| test('canonical consult skill has updated model names', () => { | ||||||
| expect(consultSkillContent).toContain('claude-haiku-4-5'); | ||||||
| expect(consultSkillContent).toContain('claude-sonnet-4-6'); | ||||||
| expect(consultSkillContent).toContain('claude-opus-4-6'); | ||||||
| expect(consultSkillContent).not.toContain('gpt-5.3-codex'); | ||||||
| expect(consultSkillContent).toContain('o4-mini'); | ||||||
| expect(consultSkillContent).toContain('o3'); | ||||||
| }); | ||||||
|
Comment on lines
+729
to
+736
|
||||||
| }); | ||||||
|
Comment on lines
+709
to
+737
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Section 15 of the tests verifies the consult skill adapter sync but completely omits the Gemini model updates mentioned in the PR description. Adding assertions for the new Gemini preview models will ensure that both the OpenCode adapter and the canonical consult skill are correctly updated. describe('consult skill opencode adapter sync (#232)', () => {
test('opencode consult adapter contains all 5 providers', () => {
for (const provider of ['claude', 'gemini', 'codex', 'opencode', 'copilot']) {
expect(openCodeConsultSkillContent.toLowerCase()).toContain(provider);
}
});
test('opencode consult adapter has updated claude model names', () => {
expect(openCodeConsultSkillContent).toContain('claude-haiku-4-5');
expect(openCodeConsultSkillContent).toContain('claude-sonnet-4-6');
expect(openCodeConsultSkillContent).toContain('claude-opus-4-6');
});
test('opencode consult adapter has updated gemini model names', () => {
expect(openCodeConsultSkillContent).toContain('gemini-3-flash-preview');
expect(openCodeConsultSkillContent).toContain('gemini-3-pro-preview');
expect(openCodeConsultSkillContent).toContain('gemini-3.1-pro-preview');
});
test('opencode consult adapter has updated codex model names (no speculative gpt-5.x)', () => {
expect(openCodeConsultSkillContent).not.toContain('gpt-5.3-codex');
expect(openCodeConsultSkillContent).not.toContain('gpt-5.2-codex');
expect(openCodeConsultSkillContent).toContain('o4-mini');
expect(openCodeConsultSkillContent).toContain('o3');
});
test('canonical consult skill has updated model names', () => {
expect(consultSkillContent).toContain('claude-haiku-4-5');
expect(consultSkillContent).toContain('claude-sonnet-4-6');
expect(consultSkillContent).toContain('claude-opus-4-6');
expect(consultSkillContent).toContain('gemini-3-flash-preview');
expect(consultSkillContent).toContain('gemini-3-pro-preview');
expect(consultSkillContent).toContain('gemini-3.1-pro-preview');
expect(consultSkillContent).not.toContain('gpt-5.3-codex');
expect(consultSkillContent).toContain('o4-mini');
expect(consultSkillContent).toContain('o3');
});
}); |
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -271,6 +271,39 @@ The consult skill's table covers: Anthropic keys (`sk-*`, `sk-ant-*`), OpenAI pr | |||||
|
|
||||||
| Read the consult skill file to get the exact patterns and replacements. | ||||||
|
|
||||||
| ## External Tool Quick Reference | ||||||
|
|
||||||
| > Canonical source: `plugins/consult/skills/consult/SKILL.md`. This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly. | ||||||
|
|
||||||
| ### Safe Command Patterns | ||||||
|
|
||||||
| | Provider | Safe Command Pattern | | ||||||
| |----------|---------------------| | ||||||
| | Claude | `claude -p - --output-format json --model "MODEL" --max-turns TURNS --allowedTools "Read,Glob,Grep" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Gemini | `gemini -p - --output-format json -m "MODEL" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | ||||||
|
||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | |
| | Codex | `codex exec "$(cat '{AI_STATE_DIR}/consult/question.tmp')" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -275,6 +275,39 @@ The consult skill's table covers: Anthropic keys (`sk-*`, `sk-ant-*`), OpenAI pr | |||||
|
|
||||||
| Read the consult skill file to get the exact patterns and replacements. | ||||||
|
|
||||||
| ## External Tool Quick Reference | ||||||
|
|
||||||
| > Canonical source: `plugins/consult/skills/consult/SKILL.md`. This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly. | ||||||
|
|
||||||
| ### Safe Command Patterns | ||||||
|
|
||||||
| | Provider | Safe Command Pattern | | ||||||
| |----------|---------------------| | ||||||
| | Claude | `claude -p - --output-format json --model "MODEL" --max-turns TURNS --allowedTools "Read,Glob,Grep" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Gemini | `gemini -p - --output-format json -m "MODEL" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | ||||||
|
||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | |
| | Codex | `codex exec "$(cat \"{AI_STATE_DIR}/consult/question.tmp\")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -259,13 +259,35 @@ Platform state directory: | |||||
| | Tool invocation timeout (>240s) | Round 1 proposer: abort. Round 1 challenger: proceed with uncontested. Round 2+: synthesize from completed rounds with timeout note. | | ||||||
| | All rounds timeout | "[ERROR] Debate failed: all tool invocations timed out." | | ||||||
|
|
||||||
| ## Consult Skill Integration | ||||||
|
|
||||||
| Each tool invocation uses the existing `consult` skill from the consult plugin. The orchestrator invokes it as: | ||||||
|
|
||||||
| ``` | ||||||
| Skill: consult | ||||||
| Args: "{debate prompt with context}" --tool={tool} --effort={effort} --model={model} | ||||||
| ``` | ||||||
|
|
||||||
| The consult skill handles: provider command building, safe question passing (temp file), output parsing, and secret redaction. The debate skill does NOT duplicate this logic. | ||||||
| ## External Tool Quick Reference | ||||||
|
|
||||||
| > Canonical source: consult skill (`consult/SKILL.md`). This table is for **planning reference only** -- always invoke via `Skill: consult`, which handles safe question passing, temp file creation, and cleanup. Do NOT execute these commands directly. | ||||||
|
|
||||||
| ### Safe Command Patterns | ||||||
|
|
||||||
| | Provider | Safe Command Pattern | | ||||||
| |----------|---------------------| | ||||||
| | Claude | `claude -p - --output-format json --model "MODEL" --max-turns TURNS --allowedTools "Read,Glob,Grep" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Gemini | `gemini -p - --output-format json -m "MODEL" < "{AI_STATE_DIR}/consult/question.tmp"` | | ||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | ||||||
|
||||||
| | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | | |
| | Codex | `codex exec "$(cat '{AI_STATE_DIR}/consult/question.tmp')" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar: use “an External Tool Quick Reference section” (External starts with a vowel sound).