DRAFT feat(consensus): add multi-lineage consensus tool#4703
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
No issues found across 22 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: While the PR is well-structured and adds a useful feature, the scope (845 lines, 22 files) and the strict '100% sure no regressions' criterion make auto-approval risky without a deeper review.
Re-trigger cubic
Codegraph-assisted reviewBlocking / should resolve
How codegraph helpedI used Local verification
|
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: This PR adds a large new multi-lineage consensus tool with 863 lines of changed code spanning new orchestration, voter spawning, model lineage resolution, configuration, and prompt integration, and while automated review found no issues, the strict requirement of zero regressions cannot be met with
Re-trigger cubic
code-yeongyu
left a comment
There was a problem hiding this comment.
Requesting changes for deprecated GPT model references in this PR.\n\nThe current dev branch has moved off gpt-5.2/gpt-5.3 and now uses the GPT-5.5-era IDs where applicable. This PR diff still adds stale references such as:\n\n634:+ gpt: ["gpt-5.5", "gpt-5.4", "gpt-5.3-codex"],\n\nPlease update the PR so it does not introduce gpt-5.2/gpt-5.3 in runtime config, docs, fallback chains, snapshots, or ordinary test fixtures. If a deprecated ID is truly needed as a migration-input fixture, isolate it as an explicit historical/deprecated-input test and make sure the migrated/current output is GPT-5.5-era, not 5.2/5.3.
Adds a `consensus` tool that spawns N voters (default 3) from different model families (Anthropic / OpenAI / Google / open-source) in parallel, gives each the same question, and returns their positions for the calling agent to synthesize. Restricted to the main agent; subagents cannot invoke it. - src/features/consensus: engine, voter-spawner (single-shot framing, disabled delegation tools, configurable reasoning effort), voter-resolver (live-provider resolution with stale-cache fallback), types. - src/tools/consensus: the main-agent-only consensus tool, gated on session role. - src/shared/model-lineage: voter pool and lineage diversity selection. - src/config/schema/consensus: config block (voter count, lineages, timeout, reasoning effort), composed into the root config schema. - Register the consensus tool in tool-registry, config-gated (default on). - Promote consensus in all six Sisyphus prompt variants (structured section plus gpt-5-5 prose), mirroring the Oracle guidance section.
voter-spawner called ctx.client.session.prompt directly, bypassing the internal prompt dispatch gate and tripping the prompt-async-route audit. Route the voter prompt through dispatchInternalPrompt (mode: sync, queueBehavior: defer), matching the call-omo-agent sync executor, and handle accepted/ambiguous/skipped dispatch results before polling. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
619a131 to
3bf6946
Compare
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: While the implementation appears well-structured and the AI review found no issues, the addition of a new multi-lineage consensus subsystem spanning over 1100 lines across 15+ files (including changes to core agent prompts, config schema, tool registry, and session handling) introduces inherent...
Re-trigger cubic
code-yeongyu
left a comment
There was a problem hiding this comment.
Approved after maintainer fixup.\n\nVerified the PR diff no longer introduces gpt-5.2/gpt-5.3 or hyphenated stale variants, the consensus fixes address the prior deprecated-model/requested-change concern, local targeted Codex cleanup test and full test:codex passed, and CI/build/Codex compatibility are green on f55f41c. Cubic also reports 0 issues on the current head.
Summary
consensustool: spawns N voters (default 3) from different model families (Anthropic / OpenAI / Google / open-source) in parallel, gives each the same question, and returns their positions for the calling agent to synthesize.Changes
The tool & core logic
src/tools/consensus/tool.ts— theconsensustool definition: description the agent sees, args (prompt,count,caller_model,exclude_lineages), main-agent-only gating, and the synthesizer guidance returned to the caller.src/features/consensus/consensus-engine.ts— orchestration: fetches connected providers + available models, selects diverse voters (excluding the caller's own lineage), spawns them in parallel, aggregates positions, and flagsadvisoryOnlywhen fewer than two voters return a usable answer.src/features/consensus/voter-resolver.ts— resolves each candidate to a connected provider + a promptable model id, with a stale-cache fallback so a just-connected provider still resolves.src/features/consensus/voter-spawner.ts— spawns a one-shot voter session: framing (answer directly, do not delegate or wait), delegation/question tools disabled, configurable reasoning effort, polls to completion, and cleans up the temporary session.src/shared/model-lineage.ts— the default voter pool (model families) and lineage-diversity selection.src/features/consensus/types.ts— shared types (VoterPosition,ConsensusResult,ResolvedVoterCandidate).Config
src/config/schema/consensus.ts— config block: voter count, lineages, per-voter timeout, reasoning effort, and the gate sub-configs.src/config/schema/oh-my-opencode-config.ts— composesConsensusConfigSchemainto the root config schema.Wiring
src/plugin/tool-registry.ts— registers theconsensustool, config-gated (default on).src/tools/index.ts,src/tools/consensus/index.ts,src/features/consensus/index.ts— barrel exports.Prompt promotion
src/agents/dynamic-agent-core-sections.ts—buildConsensusSection()(rendered only when the tool is registered), mirroring the existing Oracle section.src/agents/dynamic-agent-prompt-builder.ts— exports the new section.src/agents/sisyphus.ts,src/agents/sisyphus/{default,claude-opus-4-7,gpt-5-4,kimi-k2-6}.ts— inject the structured section next to Oracle;src/agents/sisyphus/gpt-5-5.ts— matching prose paragraph for the prose-style variant.Generated
assets/oh-my-opencode.schema.json— regenerated from the updated config schema.Testing
bun run typecheck bun testtsgo --noEmitpasses clean. The tool was also exercised end-to-end with a Claude main agent (caller_model="claude-opus-4-8"), which resolved and collected three voters — GPT-5.5 (OpenAI), Gemini 3.1 Pro (Google Vertex), and Kimi K2.6 (OpenCode Zen) — all returning positions, withadvisoryOnlycorrectly false.Related Issues
Summary by cubic
Adds a
consensustool that runs parallel voters from different model families and returns their positions for the main agent to synthesize. Also relaxes a Windows installer test timeout to reduce flakiness.New Features
consensustool (main‑agent only): argsprompt,count,caller_model,exclude_lineages; picks diverse voters (excludes caller lineage), resolves against connected providers with stale‑inventory fallback, spawns one‑shot voters with delegation disabled, aggregates results, flagsadvisoryOnlywhen <2 usable answers.consensusblock (default voter count/lineages, per‑voter timeout, reasoning effort, optional pre‑question and post‑test gates); tool registered insrc/plugin/tool-registry.ts(config‑gated, default on); regeneratedassets/oh-my-opencode.schema.json.Bug Fixes
dispatchInternalPrompt, mode: sync,queueBehavior: defer) and handled accepted/ambiguous/skipped outcomes before polling.gpt-5.4(-mini)) and rejects Codex‑era matches.Written for commit f55f41c. Summary will update on new commits.