fix: /debate command now manages debate workflow directly (#231)#237
fix: /debate command now manages debate workflow directly (#231)#237
Conversation
…delegating to orchestrator agent Move debate orchestration logic (skill invocation, round execution, verdict synthesis, state saving) from debate-orchestrator agent into the /debate command itself, following the /consult pattern. The debate-orchestrator agent is now the programmatic entry point for other agents/workflows that need to spawn debates via Task(). Direct user invocations use the command path. Syncs OpenCode and Codex adapters. Fixes #231
The /debate command was refactored from delegating to debate-orchestrator to executing the debate workflow inline (Skill: debate + Skill: consult per round). Update 4 tests that checked for the old spawn pattern: - command spawns debate:debate-orchestrator -> invokes skills inline - command invokes skill via Task tool in Phase 3 -> Skill blocks in Phase 3 - command handles orchestrator failure -> handles tool failure during debate - orchestrator description mentions proposer/challenger -> programmatic entry point
…, least-privilege tools - Add inline failure-handling directives in Phase 3b round loop across all 3 command files (plugin, opencode adapter, codex adapter) for both proposer and challenger consult invocations - Remove Task from allowed-tools in plugin command (least-privilege; command uses Skill: directly, not Task) - Strengthen test assertion for command/agent skill reference - Add negative regression test ensuring command does not spawn debate-orchestrator via Task - Add test for Skill in allowed-tools, add negative test for Task removal - Add Challenger fails round 1 check to error handling test - Remove duplicate skill version test from alignment block (kept in cross-file consistency block)
… sanitization test
- Update Error Handling table in all 3 command files to match the inline
Phase 3b challenger failure message exactly:
`[WARN] Challenger ({tool}) failed on round 1. Proceeding with uncontested proposer position.`
- Add "MUST sanitize all tool output before displaying" constraint to all 3
command files (already present in orchestrator agent, now ported to commands)
- Add test verifying command has Output Sanitization section
Add unreleased entry for /debate command inline orchestration refactor.
…r phrases - debate-orchestrator: capabilities-focused description replacing "Programmatic entry point..." wording - debate-orchestrator: simplify Role section triad paragraph to two-line summary - adapters/codex/skills/debate/SKILL.md: add missing version and argument-hint fields - adapters/opencode/commands/debate.md: add missing name field to frontmatter - debate command (plugins + opencode): add trigger phrases to description for better command routing
Summary of ChangesHello @avifenesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the internal architecture of the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1352c45ed1
ℹ️ 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".
… CI test The test 'orchestrator description describes programmatic entry point' asserts the agent description contains /programmatic/i and /Task()/. The description had 'Task()' but was missing 'programmatic'. Updated to: 'Programmatic entry point for other agents or workflows that need to spawn a structured debate via Task().'
Update adapters/opencode/agents/debate-orchestrator.md description to match the updated plugins/debate/agents/debate-orchestrator.md description, keeping both files in sync as required by the adapter-freshness check.
…-tools Without Bash(claude:*), Bash(gemini:*) etc., all Skill: consult calls in the debate command would fail at runtime since skills execute within the command's tool permission scope.
avifenesh
left a comment
There was a problem hiding this comment.
Fixed in the latest commit. Added Bash(claude:), Bash(gemini:), Bash(codex:), Bash(opencode:), Bash(copilot:), Bash(git:) to allowed-tools in the /debate command, matching the permissions previously held by the debate-orchestrator agent and mirroring the /consult command's tool scope.
There was a problem hiding this comment.
Code Review
The pull request successfully transitions the /debate command from a delegated orchestration model (using Task()) to an inline orchestration model (using Skill: debate and Skill: consult). This change aligns /debate with the pattern used by /consult, improving consistency and control. The debate-orchestrator agent is correctly repositioned as a programmatic entry point for other workflows. The updates to the adapters and tests are thorough. I have identified a few minor inconsistencies in placeholder naming and logic for round-based summarization that should be addressed for better agent reliability.
There was a problem hiding this comment.
Pull request overview
This PR fixes /debate orchestration by moving Phase 3 execution into the /debate command itself (matching the /consult pattern), while repositioning debate-orchestrator as a programmatic Task() entry point for other workflows.
Changes:
- Rewires
/debatePhase 3 to run rounds inline viaSkill: debate(templates) +Skill: consult(per-round tool calls), then synthesize verdict and save state. - Updates
debate-orchestratoragent copy to describe programmatic spawning via Task() instead of/debate. - Syncs OpenCode/Codex adapter docs and updates tests/README/CHANGELOG accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/debate/commands/debate.md | Removes Task delegation; documents inline debate execution, verdict synthesis, state saving, and sanitization guidance. |
| plugins/debate/agents/debate-orchestrator.md | Reframes orchestrator as a Task()-spawned programmatic entry point (not /debate-spawned). |
| adapters/opencode/commands/debate.md | Syncs OpenCode adapter command with the new inline execution architecture. |
| adapters/opencode/agents/debate-orchestrator.md | Syncs OpenCode adapter agent description with new programmatic spawning role. |
| adapters/codex/skills/debate/SKILL.md | Syncs Codex adapter debate spec text to reflect inline execution approach. |
| tests/debate-command.test.js | Updates assertions to validate inline Skill execution and least-privilege (no Task) behavior. |
| README.md | Updates /debate one-line description in the generated commands table. |
| CHANGELOG.md | Adds an Unreleased “Fixed” entry for issue #231. |
| package-lock.json | Lockfile metadata changes consistent with regeneration/update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tribution, process.env wording, stale agent references
- Replace {N} with {round} in round display headers (proposer and challenger) for consistency
- Fix context assembly rule: "rounds 1 through N-2" -> "rounds 1 through {round}-2" to correctly refer to current round
- Correct sk-proj-* attribution: it is an OpenAI project key, not an Anthropic key
- Replace process.env.AI_STATE_DIR with plain English "AI_STATE_DIR environment variable" in Phase 3d
- Update debate-orchestrator agent: replace "pre-resolved by the /debate command" with "pre-resolved by the caller" and fix error message to match
- Regenerate OpenCode and Codex adapter files via gen-adapters.js
|
The Bash tool permissions issue has been addressed in commit 55f06bd, which added Bash(claude:), Bash(gemini:), Bash(codex:), Bash(opencode:), Bash(copilot:), and Bash(git:) to the /debate command's allowed-tools frontmatter. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fac294230e
ℹ️ 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".
| Skill: debate | ||
| Args: "[topic]" --proposer=[proposer] --challenger=[challenger] --rounds=[rounds] --effort=[effort] |
There was a problem hiding this comment.
Avoid self-invoking the Codex debate skill
In the Codex adapter, this file is itself the debate skill (name: debate at the top), but Phase 3a now tells the runtime to invoke Skill: debate; because there is no separate debate-template skill in adapters/codex/skills/, this resolves back to the same skill and can recurse instead of loading templates, which blocks /debate execution on Codex installs. This was introduced by replacing the prior Task-based flow with an inline Skill: debate call.
Useful? React with 👍 / 👎.
Summary
/debatecommand was delegating ALL orchestration to thedebate-orchestratoragent via a singleTask()call, instead of managing the workflow directly/debatePhase 3 to execute the debate inline: invokeSkill: debatefor templates, callSkill: consultper round (proposer + challenger), synthesize verdict, save statedebate-orchestratoragent as the programmatic entry point for other agents/workflows that need to spawn debates viaTask()— mirrors howconsult-agentrelates to/consultgen-adaptersto keep them freshArchitecture Change
Before (broken):
After (correct, matches /consult pattern):
Test Plan
command does not spawn debate-orchestrator via Tasknpx agentsys-dev validatepasses (13 plugins, 42 agents, 28 skills)npx agentsys-dev preflight --allpasses (13/13 checks)/enhancerun on all modified agents, commands, and skills