Skip to content

[limen LIMEN-004] Open Codex task two - #29

Closed
4444J99 wants to merge 1 commit into
mainfrom
limen/limen-004-40e7
Closed

[limen LIMEN-004] Open Codex task two#29
4444J99 wants to merge 1 commit into
mainfrom
limen/limen-004-40e7

Conversation

@4444J99

@4444J99 4444J99 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Autonomous limen dispatch of task LIMEN-004.

Produced in an isolated worktree off origin — review before merge.

Summary by Sourcery

Enhancements:

  • Add support for using a LIMEN_DISPATCH_CMD environment override for agent dispatch while retaining the existing agent-dispatch fallback behavior.

limen task LIMEN-004
@sourcery-ai

sourcery-ai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds support for a custom LIMEN_DISPATCH_CMD environment variable that, when set, is used directly for non-jules agents before falling back to local agents or the default 'agent-dispatch' command, slightly reordering the dispatch resolution logic.

Flow diagram for updated call_agent_dispatch logic

flowchart TD
    start([call_agent_dispatch])
    jules{agent == 'jules'}
    env{LIMEN_DISPATCH_CMD is set}
    local{agent in _LOCAL_AGENTS}
    default_cmd([Use 'agent-dispatch'])
    run_env([Run _run_cmd with LIMEN_DISPATCH_CMD])
    run_local([Call _call_local_agent])
    run_jules([Call _call_jules])

    start --> jules
    jules -->|yes| run_jules
    jules -->|no| env
    env -->|yes| run_env
    env -->|no| local
    local -->|yes| run_local
    local -->|no| default_cmd
    default_cmd --> run_env
Loading

File-Level Changes

Change Details Files
Support an explicit LIMEN_DISPATCH_CMD override for non-jules agents and adjust dispatch resolution order.
  • After handling the special-case 'jules' agent, read LIMEN_DISPATCH_CMD from the environment and, if set, dispatch using that command with the built prompt before checking local agents.
  • Change the default behavior for non-local agents so that LIMEN_DISPATCH_CMD is no longer read with a default, instead always using the literal 'agent-dispatch' command when the environment variable is not set or was already handled.
  • Ensure the prompt is only built once per dispatch path and passed along with the agent to the selected command runner.
cli/src/limen/dispatch.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the agent dispatch logic in cli/src/limen/dispatch.py by checking and executing LIMEN_DISPATCH_CMD before verifying if the agent is a local agent. However, this change bypasses the local agent check, which violates the Worktree Isolation protocol. It is recommended to restore the _LOCAL_AGENTS check before applying LIMEN_DISPATCH_CMD to ensure local agents run in isolated git worktrees.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cli/src/limen/dispatch.py
Comment on lines +28 to 37
dispatch_cmd = os.environ.get("LIMEN_DISPATCH_CMD")
if dispatch_cmd:
prompt = _build_prompt(task)
return _run_cmd([dispatch_cmd, agent, prompt], task, dry_run)
if agent in _LOCAL_AGENTS:
return _call_local_agent(agent, task, dry_run)
dispatch_cmd = os.environ.get("LIMEN_DISPATCH_CMD", "agent-dispatch")
dispatch_cmd = "agent-dispatch"
prompt = _build_prompt(task)
cmd = [dispatch_cmd, agent, prompt]
return _run_cmd(cmd, task, dry_run)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Bypassing the _LOCAL_AGENTS check when LIMEN_DISPATCH_CMD is set violates the Worktree Isolation protocol. Local agents (such as codex, opencode, etc.) must run in isolated git worktrees via _call_local_agent to prevent parallel task conflicts in the shared working directory. Checking LIMEN_DISPATCH_CMD first completely bypasses this isolation.

Please restore the check for _LOCAL_AGENTS before checking or applying LIMEN_DISPATCH_CMD.

Suggested change
dispatch_cmd = os.environ.get("LIMEN_DISPATCH_CMD")
if dispatch_cmd:
prompt = _build_prompt(task)
return _run_cmd([dispatch_cmd, agent, prompt], task, dry_run)
if agent in _LOCAL_AGENTS:
return _call_local_agent(agent, task, dry_run)
dispatch_cmd = os.environ.get("LIMEN_DISPATCH_CMD", "agent-dispatch")
dispatch_cmd = "agent-dispatch"
prompt = _build_prompt(task)
cmd = [dispatch_cmd, agent, prompt]
return _run_cmd(cmd, task, dry_run)
if agent in _LOCAL_AGENTS:
return _call_local_agent(agent, task, dry_run)
dispatch_cmd = os.environ.get("LIMEN_DISPATCH_CMD", "agent-dispatch")
prompt = _build_prompt(task)
cmd = [dispatch_cmd, agent, prompt]
return _run_cmd(cmd, task, dry_run)
References
  1. Execution Protocols - 1. Worktree Isolation: Instead of cloning or checking out branches in the main repository checkout, the Conductor Swarm MUST spawn tasks in isolated git worktrees. (link)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new ordering means LIMEN_DISPATCH_CMD is now used for agents in _LOCAL_AGENTS instead of _call_local_agent, which changes behavior; consider whether local agents should still bypass external dispatch and, if so, move the _LOCAL_AGENTS check before the LIMEN_DISPATCH_CMD branch.
  • You now build the prompt twice along different branches; consider refactoring to compute prompt = _build_prompt(task) once before the dispatch command selection to avoid duplication.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new ordering means `LIMEN_DISPATCH_CMD` is now used for agents in `_LOCAL_AGENTS` instead of `_call_local_agent`, which changes behavior; consider whether local agents should still bypass external dispatch and, if so, move the `_LOCAL_AGENTS` check before the `LIMEN_DISPATCH_CMD` branch.
- You now build the prompt twice along different branches; consider refactoring to compute `prompt = _build_prompt(task)` once before the dispatch command selection to avoid duplication.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07550bf03a

ℹ️ 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".

Comment thread cli/src/limen/dispatch.py
Comment on lines +29 to +31
if dispatch_cmd:
prompt = _build_prompt(task)
return _run_cmd([dispatch_cmd, agent, prompt], task, dry_run)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep local lanes on the isolated dispatch path

When LIMEN_DISPATCH_CMD is set in an environment that dispatches a local lane, this branch runs before agent in _LOCAL_AGENTS, so codex/opencode/agy/claude no longer reach _isolated_local_run and therefore skip the worktree → commit → push → PR flow used by scripts/metabolize.sh. Any wrapper that exits 0 will still make dispatch_tasks mark the task dispatched and spend budget, but without the promised reviewable PR or live-checkout isolation; please keep local agents on _call_local_agent unless LIMEN_ISOLATION=off is explicitly requested.

Useful? React with 👍 / 👎.

@4444J99

4444J99 commented Jun 25, 2026

Copy link
Copy Markdown
Owner Author

superseded by #31 (newest dispatch of same fleet task: LIMEN-004)

@4444J99 4444J99 closed this Jun 25, 2026
@4444J99
4444J99 deleted the limen/limen-004-40e7 branch June 27, 2026 02:15
4444J99 added a commit that referenced this pull request Jul 1, 2026
Each owner records its own remaining work (closeout discipline): what landed, the
larger media-ark repo effort (red CI issue #5, conflicting PRs #29/#34/#42, undeployed
+ $0), the Spine-B next slices (real send, media-ark index select, beat wiring), the
aspirational vision slices, and the 5 human levers.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4444J99 added a commit that referenced this pull request Jul 1, 2026
media-ark CI is green on main for the first time (organvm/media-ark#51,
merged c28bf83). Update the residual record: correct issue #5's stale
runner-pickup theory (real cause was the half-landed #43 auth refactor +
a src/platform stdlib-shadow + a broken tox invocation), and log the
remaining atoms — 5 superseded dud PRs to close and issue #5 to close
(both classifier-gated external writes, one-liners recorded), the 3
CONFLICTING feature PRs (#29/#34/#42), and the src/platform rename as the
permanent shadow fix.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4444J99 added a commit that referenced this pull request Jul 1, 2026
…g / deploy (#519)

media-ark PR #52 (9371420) landed the per-user quota/paywall: #29 rebased onto
green main with its spoofable X-User-Tier header model reconciled onto the
AuthStore bearer identity (tier is ledger-owned). Update organs/media/NEXT.md —
mark #29 DONE, fold the close-#29 hygiene atom into the dud-PR one-liner, and
scope the two remaining chunks: Phase 2 (wire the paywall to MONETA's offline
ECDSA-P256 licence via a pure-stdlib verifier + POST /api/license) and Phase 3
(deploy — owner hosting decision, the true revenue bottleneck).

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4444J99 added a commit that referenced this pull request Jul 14, 2026
- 8 documented-residue (CLASS 1): logs/ or .tmp-* only untracked,
  HEAD is ancestor of origin/default, unpushed=0
- 8 remote-pr-open (CLASS 2): pushed existing commits, opened draft
  PRs or captured existing open PR

Roots receipted:
  heal-cifix-organvm-a-i--skills-27-7ed7339a (documented-residue)
  heal-cifix-organvm-a-i--skills-27-8f4677cb (documented-residue)
  heal-cifix-organvm-bountyscope-13-c8378dbc (documented-residue)
  heal-cifix-organvm-growth-auditor-13-8e0b3a07 (documented-residue)
  heal-cifix-organvm-growth-auditor-13-b800950c (documented-residue)
  heal-cifix-organvm-growth-auditor-16-aa9e65aa (documented-residue)
  heal-cifix-organvm-organvm-engine-100-93e5b4a5 (documented-residue)
  heal-cifix-organvm-organvm-ontologia-11-55899198 (documented-residue)
  aw-public-face-contribution-balance-3112b780 (remote-pr-open #1056)
  heal-cifix-organvm-conversation-corpus-engine-42-28f71173 (remote-pr-open #61)
  heal-cifix-organvm-domus-genoma-136-6a8c088f (remote-pr-open #136 existing)
  heal-cifix-organvm-growth-auditor-11-171607f7 (remote-pr-open #26)
  heal-cifix-organvm-growth-auditor-11-ddbe8b4c (remote-pr-open #27)
  heal-cifix-organvm-growth-auditor-12-18efdd4f (remote-pr-open #28)
  heal-cifix-organvm-growth-auditor-13-1d41d80b (remote-pr-open #29)
  heal-cifix-organvm-growth-auditor-13-bc0b11cc (remote-pr-open #30)

Campaign: #685

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
4444J99 added a commit that referenced this pull request Jul 15, 2026
…ark atoms operator-cleared (#1100)

Ports the single unique commit preserved from the feat-gcp-sa-organ worktree
(PR #544 merged through f20bb66; local HEAD 0a4f21f held only this one-file
owner-record update). Marks the media-ark superseded-PR closes
(#44/#45/#46/#48/#49/#29) and issue #5 close DONE (operator cleared
in-session, 2026-07-01).

Resolves row feat-gcp-sa-organ (owner_commit_needs_packet) of
prompt-batch-critical-owner-blocker-001.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant