feat(lfg): add delegate flag and configurable MCP/agent providers#13
Closed
feat(lfg): add delegate flag and configurable MCP/agent providers#13
Conversation
Adds delegate:codex|delegate:local and mcp:<list> argument tokens plus matching config keys (lfg_delegate, lfg_mcp_providers, lfg_adversarial_review). When delegation is active the work phase routes to ce-work-beta; codex MCP serves as fallback and as a parallel adversarial review lane alongside ce-code-review. Perplexity in the provider list is passed as a research hint to ce-plan and the work skill. Residuals from the codex lane flow through the standard handoff; low-confidence autofixes appear in a dedicated subsection so the user can re-direct.
Address review findings from ce-code-review and parallel codex MCP adversarial lane on the lfg delegation/MCP-config skill: - Drop the misleading 'ce-work-beta owns CLI/MCP fallback' claim: ce-work-beta delegates via codex exec only. Document that codex MCP is used solely for the adversarial review lane, not as work-phase fallback. Tighten the global delegation fallback to check codex CLI alone. - Restructure step 3 as a single review phase that explicitly dispatches the ce-code-review and codex MCP adversarial lanes in the same agent response, removing the prior 3/3b ambiguity. - Tighten the adversarial-lane gate to adversarial_review_active AND codex_mcp_available (drop the providers-only OR branch) and suppress the skip notice when adversarial_review_active was default-derived AND codex MCP is unavailable. - Synthesize owner: downstream-resolver / autofix_class on codex residuals so they flow through the standard residual handoff. - Build a finding_id-indexed merged list before tracker-defer so the rendered markdown can preserve confidence, requires_human_judgment, and applied-autofix metadata after tracker-defer's lightweight return. - Add an inline [needs human review] marker for not-autofixed judgment-required findings; keep the low-confidence-applied subsection for autofixed items. - Add explicit token-normalization rules (case, empty mcp:, whitespace, repeated tokens, unknown delegate values, mcp:none escape hatch). - Specify mcp_providers as union (arg + config), with mcp:none as the exclusion mechanism. - Drop unused delegation_source state var; clarify the Provider auto-invoke mapping as a closed set. - Fix step 7 stale 'step 5 already opened a PR' wording. - Codex adversarial prompt: explicitly forbid file modifications.
4 tasks
Owner
Author
|
Superseded by #14, which moves these changes into a new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds delegation and configurable MCP/agent provider support to the
lfgautonomous-pipeline skill so the user-level CLAUDE.md two-lane review pattern can fire from the autopilot path.delegate:codex/delegate:localargument tokens (and matchinglfg_delegateconfig key) route the work phase throughce-work-beta delegate:codexinstead ofce-work.mcp:<list>argument token (andlfg_mcp_providersconfig) accepts simple provider names;codexenables the parallel adversarial review lane,perplexityis passed as a research hint intoce-planand the work skill. The set is intentionally closed for now; unknown names no-op with a notice.ce-code-review mode:autofixandmcp__codex__codexadversarial in the same response so they execute in parallel; codex residuals flow through the standard residual handoff with synthesizedowner: downstream-resolverandsource: codex-adversarialtags.## Residual Review Findingsgains anItems applied with low confidencesubsection plus an inline[needs human review]marker for findings flaggedrequires_human_judgmentso the user can spot redirect-worthy items.Files
docs/plans/2026-05-06-001-feat-lfg-delegate-and-mcp-config-plan.mdplugins/compound-engineering/skills/lfg/SKILL.mdplugins/compound-engineering/skills/lfg/references/codex-adversarial-prompt.md.compound-engineering/config.local.example.yaml(newlfg_*keys documented)Review
Ran ce-code-review (project-standards + correctness + maintainability) in parallel with the codex MCP adversarial lane per the new design. Autofixes applied in commit
88ca47a6:ce-work-betaonly delegates viacodex exec, not MCP. Adversarial codex MCP is now scoped to the review lane only.adversarial_review_active AND codex_mcp_available, dropping the OR-providers branch that would have admitted the lane when the tool wasn't loaded.owner,autofix_class).finding_idso the rendered markdown preservesconfidence/requires_human_judgment/suggested_fixafter tracker-defer's lightweight return.mcp:noneescape hatch, union semantics for the list).Test plan
bun test(1246 pass, 0 fail)bun run release:validate(sync clean)tests/skill-shell-safety.test.ts(new pre-resolution blocks pass; one safety failure during dev was fixed by wrapping&&in a subshell)tests/frontmatter.test.tsplugins/compound-engineering/AGENTS.md, behavioral changes to skills require skill-creator evals; recommended before merge for U1 (token parsing), U2 (delegation routing), U3 (parallel adversarial lane).Items needing your judgment
The original ask said "delegate to codex CLI (or MCP, as fallback) as needed". The codex adversarial review surfaced that this isn't actually achievable today:
ce-work-betaonly delegates viacodex exec(CLI), not via the codex MCP. The skill prose now reflects what's actually implemented (CLI for work; MCP for adversarial review). Three options if you want CLI-or-MCP delegation for the work phase:mcp__codex__codexwith the plan and unit prompts itself when CLI is missing. Bypasses ce-work-beta entirely on that path; large new surface.Let me know which you want; option 1 ships as-is in this PR.