Skip to content

ce-work-beta: delegation silently falls back to standard mode when references/codex-delegation-workflow.md is read relative to project CWD #949

Description

@dskarasev

Summary

When ce-work-beta is invoked with a plan file and delegation_active=true (via config.local.yaml), the skill silently falls back to standard Claude Code execution instead of delegating to Codex CLI.

Root Cause

SKILL.md (both marketplace and 3.12.0 cache) references the delegation workflow as a relative path:

read `references/codex-delegation-workflow.md`

When the skill runs, the agent's CWD is the project root (e.g., ~/git/myproject), not the skill directory. The Read tool looks for the file at ~/git/myproject/references/codex-delegation-workflow.md — which doesn't exist. The read fails silently and the agent falls through to the standard strategy table, never invoking Codex.

Affected files (same pattern in both):

  • plugins/compound-engineering/skills/ce-work-beta/SKILL.md — 3 occurrences
  • cache/.../3.12.0/skills/ce-work-beta/SKILL.md — 3 occurrences

Steps to Reproduce

  1. Configure a project with .compound-engineering/config.local.yaml:
    work_delegate: codex
    work_delegate_consent: true
    work_delegate_sandbox: yolo
    work_delegate_decision: auto
  2. Create a plan file with non-trivial implementation units
  3. Run /ce-work-beta docs/plans/my-plan.md
  4. Observe: agent implements code directly without invoking codex exec

Expected Behavior

When delegation_active=true and input is a plan file, the skill should read references/codex-delegation-workflow.md and follow its delegation flow, resulting in codex exec being called.

Suggested Fix

Add a !-pre-resolution at skill load time that resolves the absolute path to the references/ directory, then reference all references/*.md files using that pre-resolved path:

**Skill references directory (pre-resolved at skill load):**
!`find ~/.claude/plugins -name "codex-delegation-workflow.md" -path "*/ce-work-beta/*" 2>/dev/null | xargs -I{} dirname {} | head -1`

If the line above shows an absolute path, use it as `<skill-references-dir>` when reading any `references/` file in this skill. If empty, find at runtime with the same command.

Then replace all three occurrences of `references/codex-delegation-workflow.md` with `<skill-references-dir>/codex-delegation-workflow.md` in the Delegation routing gate, Phase 2 execution loop, and Codex Delegation Mode sections.

Notes

  • This is a silent failure — no warning is emitted, the skill appears to work but Codex is never invoked
  • The ! pre-resolution already works correctly for git rev-parse --show-toplevel (config reading) — the same pattern would fix the reference file lookup
  • Verified: the fix works locally (tested in SwiftyCrow and alrosa projects)
  • Plugin update will overwrite local patches — a proper fix in the repo is needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions