Autonomous agent framework options v3

Date: 2026-06-07
Purpose: identify the actual blocker preventing reliable long-running PM/Development sessions and define concrete next steps.

Bottom line: the blocker is not the PM prompt, the Dev prompt, Telegram formatting, or the portfolio framework. The blocker is OpenClaw cron agentTurn startup reliability: scheduled isolated agent runs are entering the runner and then failing before agent execution starts. Until that runner path is fixed or bypassed, cron cannot be trusted as the durable PM/Dev execution engine.

What failed

RunExpectedObservedInterpretation
2026-06-06 23:34 PM testStart PM agent and audit portfolioFailed after about 60 seconds: isolated agent run stalled before execution start (runner-entered)The agent never reached the PM prompt.
2026-06-07 06:33 PM retestStart PM agent with lighter contextSame 60-second startup stallContext size was not the primary cause.
2026-06-07 tiny persistent-session smoke testRun a minimal NO_REPLY taskSame startup stallThe failure is in cron agentTurn runner startup, not task complexity.
2026-06-07 systemEvent fallbackWake main sessionQueued successfully and ended immediatelyUseful as a reminder/wake path, but it does not execute autonomous work by itself.

Root cause assessment

The current architecture assumed cron could directly launch long-running isolated PM and Dev agent turns. That assumption is false in the current runtime. The evidence shows a startup handshake failure before the model receives or executes the prompt.

The current failure mode is especially dangerous because it can look like a successful schedule trigger while producing no PM artifact, no Dev artifact, and no useful Telegram alert. This is why the supervision rules need to distinguish three states:

Only the third state should count as useful autonomous work. Only the second state should count as active work.

Decision: stop treating cron agentTurn as the executor

Recommendation: use cron only as a wake/checkpoint mechanism until OpenClaw cron agentTurn startup is fixed. Run long PM/Dev work through a separate durable execution path: either a TaskFlow-style local runner, Codex CLI in a supervised background process, or Codex cloud/GitHub-native tasks. OpenClaw should supervise and report, not be the only execution substrate.

Concrete implementation plan

Step 1 — Split scheduler from executor

Immediate

  1. Keep OpenClaw cron for timed wakeups and watchdog checks.
  2. Stop using cron agentTurn as the primary long-running PM/Dev executor.
  3. Represent every work cycle as a durable run record before execution starts.
  4. Require the run record to contain: run id, phase, target issue, executor type, start time, heartbeat/checkpoint deadline, output artifact, and recovery action.

Exit criteria: a triggered-but-not-started run is automatically detected as failed within minutes.

Step 2 — Build a local supervised Codex runner

Today

  1. Create a script such as scripts/run_codex_cycle.sh or scripts/run_codex_cycle.py.
  2. Inputs: role (pm or dev), target issue, repo, timeout, prompt template, allowed write scope.
  3. Output: JSON run record plus transcript/log file under a durable run directory.
  4. Run Codex CLI with explicit non-interactive flags and periodic heartbeat output so watchdogs can see liveness.
  5. Use shell/background process management, not OpenClaw isolated cron agentTurn, for long execution.

Exit criteria: one PM dry run writes a run record and either a portfolio audit artifact or a clear failure reason.

Step 3 — Make cron a launcher/checker, not the worker

Today

  1. Daily PM cron wakes main obot or runs a small shell launcher that starts the supervised Codex runner.
  2. A watchdog cron checks the run record after 5-10 minutes.
  3. If PM completes with a safe Dev target, the launcher starts Dev using the same supervised runner.
  4. If PM fails or stalls, watchdog posts one concise Telegram alert and does not pretend work is active.

Exit criteria: a PM failure produces a visible alert and a failure artifact without requiring Jeremy to ask.

Step 4 — Prefer GitHub/Codex-native execution for real development

Next

  1. Audit current Codex cloud/GitHub integration permissions for obot-claw.
  2. If available, move Dev execution to GitHub/Codex-native PR tasks where possible.
  3. Keep OpenClaw as intake, scheduling, monitoring, and Telegram reporting layer.
  4. Keep local supervised Codex runner as fallback for repos/workflows not supported by Codex cloud.

Exit criteria: one GitHub issue can go PM plan → Dev task → PR → review response with durable status and no hidden agent state.

Recommended near-term architecture

LayerUse nowWhy
SchedulerOpenClaw cron systemEvent / watchdogGood at timed reminders and main-session wakeups; current agentTurn runner is unreliable.
ExecutorSupervised Codex CLI runnerDirect process control, logs, heartbeat output, explicit timeout, recoverable failure artifacts.
Future executorCodex GitHub/cloud tasksBetter fit for repo-native PR work once permissions and workflow are confirmed.
StateGitHub issues + local run ledgerDurable, reviewable, and not dependent on chat transcript memory.
ReportingShort Telegram summary + linked durable artifact when requestedPrevents truncation and formatting drift.

Concrete next steps

  1. Do not wait for the 07:30 PM cron as a real work executor. It is currently only a wake/check path.
  2. Create issue/PR for supervised Codex runner. This should be the next implementation target in obot-claw.github.io, not safety-agent.
  3. Implement runner with explicit heartbeat. Minimum viable script: start PM prompt, write started, update heartbeat every N seconds, write completed or failed.
  4. Add watchdog validation. A separate check reads the run record and alerts if no heartbeat or artifact appears.
  5. Run one PM dry run manually. The first success criterion is not “Dev shipped code”; it is “PM run produced durable audit output and correctly started or declined Dev.”
  6. Then wire daily PM → Dev. Only after the supervised runner passes a manual test should cron own the daily flow.

What not to do

Immediate recommendation: move today’s work to a supervised Codex runner implementation. The first acceptance test should deliberately simulate a stalled run and prove Jeremy gets a concise alert plus a durable failure record.