Skip to content

refactor(cron): extract prompt executor before context accounting changes - #168718

Merged
RomneyDa merged 5 commits into
mainfrom
stack/copilot-cron-extraction-20261010
Oct 12, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
stack/copilot-cron-extraction-20261010

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Problem and solution

Extracts the isolated cron prompt executor from its dispatcher so future context-accounting changes can be reviewed separately from the mechanical move. Cron execution behavior remains unchanged.

The PR targets main directly. It adds no configuration or durable state. The obsolete max-lines baseline entry is removed without adding an exception.

Validation

Current head: b178d180d8897539c870ab2314d9c11f3784cc5c.

  • Conflict repair incorporates main c3d6aa1aa41a2ae480ce4c05aef4016b92340ad9 and refreshes the extraction from that exact source. Both function bodies are byte-identical to main, except the factory's new export keyword. All original import bindings are preserved across the two modules.
  • One executor factory and one caller remain. Existing lazy embedded/subagent runtime loaders retain their import paths and loading behavior. Main's shared command-style prompt owner is used; no duplicate detector remains.
  • Three files, +666/-658 against the integrated main. Formatting and PR-diff whitespace checks pass. The max-lines baseline change is shrink-only.
  • Fresh review of this conflict repair: no actionable findings; extraction topology, lazy runtime boundaries, and continuation-write behavior remain intact.
  • Earlier extraction topology and test-cleanup reviews found no actionable issues. The old rewind SQL-count cleanup is now already on main and is no longer part of this PR's diff.
  • Prior head 9d1d84f10f536ebc5710e96a5ef5ca59b8335fa9 passed CI run 38220120224: 48 successful jobs, 25 skipped. That is prior-head evidence; the conflict repair's new CI must be assessed separately.
  • No new tests, test seconds, full local build, or authenticated live campaign were added for this mechanical move. Exact source parity is the local proof for the conflict resolution.

Ready for review, not draft. Do not merge automatically.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 10, 2026 23:06
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves isolated cron prompt execution into an internal module and removes the obsolete line-count exception.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Exact source parity supports correctness, but current-head runtime validation remains limited and CI is pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored mechanical extraction is outside the ordinary contributor proof gate; verified source parity supports preservation, while the body supplies no current-head shipped-entry-point execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction establishes value in reviewing mechanical movement separately, and source parity keeps the implementation cost limited.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored extraction preserves execution behavior, remains distinct from current main, and has no actionable findings; reviewed-head CI is still pending.

Priority: P3
Reviewed head: b178d180d8897539c870ab2314d9c11f3784cc5c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped cron execution is demonstrated for this head; this maintainer-authored mechanical extraction is outside the ordinary contributor proof gate.
Agent review details

How this fits together

The isolated cron dispatcher receives prepared job and session inputs, executes prompt candidates through CLI or embedded runtimes, and returns results for accounting and delivery.

flowchart TD
  A[Scheduled job] --> B[Run dispatcher]
  B --> C[Prompt executor]
  C --> D[Shared execution entry]
  D --> E[CLI runtime]
  D --> F[Embedded runtime]
  E --> G[Accounting and delivery]
  F --> G
Loading

Technical review

Best possible solution:

Retain the behavior-preserving extraction and complete ordinary reviewed-head validation before human landing.

Do we have a high-confidence way to reproduce the issue?

This is a mechanical refactor rather than a bug report; source comparison verifies preserved function bodies, and no target code was executed.

Is this the best way to solve the issue?

The extraction separates orchestration from prompt execution without duplicating policy, changing persistence, or weakening existing lazy runtime boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7547acc4896b.

Provenance checked

  • Cron execution ownership keeps the original intent (e32c358: Earlier consolidation routed isolated cron through the shared agent-execution entry to avoid divergent execution and retry ownership.)
  • Lazy runtime loading keeps the original intent (35176f3: The runtime-heavy seam extraction and subsequent embedded-branch patch deferred expensive runtime loading until needed.)
  • Maximum-line suppression keeps the original intent (f81f9d8: The suppression baseline grandfathered oversized files while requiring the exception inventory to shrink.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Mechanical extraction verified: Read the pinned introduction diff and original implementation. The helper, executor factory, and dispatcher bodies match after accounting for the factory export and separator whitespace; original external import bindings remain represented across the two modules. (src/cron/isolated-agent/run-prompt-executor.ts:81, b178d180d889)
  • Single owner and lazy boundaries preserved: The extracted factory has one production caller. The dispatcher remains behind the existing lazy runtime facade, and embedded execution and descendant-registry loading retain their existing dynamic imports. (src/cron/isolated-agent/run-executor.ts:42, b178d180d889)
  • Current main retains the combined implementation: Fetched main has the same run-executor.ts as the pinned base and no run-prompt-executor.ts, so the extraction is not already implemented there. (src/cron/isolated-agent/run-executor.ts, 7547acc4896b)
  • Related accounting work is distinct: fix(cron): retain winning account context capacity #168810 describes winning-account context accounting as a separate layer depending on this mechanical extraction; its merged state does not establish that this extraction reached main.
  • Suppression ratchet respected: The patch removes the old suppression and its baseline entry without adding an exception; the original ratchet design explicitly permits shrink-only cleanup. (config/max-lines-baseline.txt:354, f81f9d8570c3)
  • Reviewed-head checks remain pending: Paginated check runs show unfinished validation and no failed checks; the aggregate CI status remains pending. GitHub reports the reviewed head mergeable, with mergeable_state blocked. Prior-head CI is not treated as current-head proof. (b178d180d889)

Likely related people:

  • Peter Steinberger: Raw commit 59fb9e5 adds src/cron/isolated-agent/run-executor.ts:43 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 59fb9e5ca7fe; files: src/cron/isolated-agent/run-executor.ts)
  • Vincent Koc: Raw commit 35176f3 adds src/cron/isolated-agent/run-executor.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 35176f3cb730; files: src/cron/isolated-agent/run-executor.ts)

PR surface

Source +9, Other -1. Total +8 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 666 657 +9
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 3 666 658 +8

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal maintenance with preserved cron behavior and no demonstrated user-facing defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (8 earlier review cycles)
  • reviewed 2026-10-10T23:12:23.095Z sha d2247c3 :: needs changes before merge. :: none
  • reviewed 2026-10-11T00:10:32.844Z sha d2247c3 :: needs changes before merge. :: none
  • reviewed 2026-10-11T00:20:39.164Z sha d2247c3 :: needs changes before merge. :: none
  • reviewed 2026-10-11T00:53:07.132Z sha 448bd0f :: needs changes before merge. :: none
  • reviewed 2026-10-12T01:42:24.782Z sha e345610 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T07:41:32.307Z sha e90a759 :: needs changes before merge. :: none
  • reviewed 2026-10-12T07:58:27.098Z sha 9d1d84f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T08:06:33.993Z sha 9d1d84f :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 6:29 PM ET / 22:29 UTC (Revision 9).

@RomneyDa
RomneyDa changed the base branch from stack/copilot-context-core-20261010 to main October 12, 2026 01:36
@RomneyDa
RomneyDa force-pushed the stack/copilot-cron-extraction-20261010 branch from 448bd0f to e345610 Compare October 12, 2026 01:36
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Oct 12, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) October 12, 2026 22:21
@RomneyDa
RomneyDa disabled auto-merge October 12, 2026 22:22
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Oct 12, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) October 12, 2026 22:45
@RomneyDa
RomneyDa disabled auto-merge October 12, 2026 22:45
@RomneyDa
RomneyDa merged commit 9646e87 into main Oct 12, 2026
133 of 134 checks passed
@RomneyDa
RomneyDa deleted the stack/copilot-cron-extraction-20261010 branch October 12, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant