Skip to content

fix: keep reminder scheduling visible in crowded Code Mode sessions - #187392

Merged
vincentkoc merged 8 commits into
openclaw:mainfrom
fonchaves:fix/gateway-exec-block-cli-footgun-187354
Nov 26, 2026
Merged

vincentkoc merged 8 commits into
openclaw:mainfrom
fonchaves:fix/gateway-exec-block-cli-footgun-187354

Conversation

@fonchaves

@fonchaves fonchaves commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Related to #187354.

What Problem This Solves

A crowded Code Mode catalog can expose shell execution while omitting the native scheduling signature. An agent can then start a second OpenClaw CLI merely to schedule a reminder. Leandro F. Chaves identified the catalog issue and proposed promoting scheduler tools in this PR.

User Impact

The compact index pins the admitted core scheduler alongside the core file and shell tools. The existing character budget, capability grants, independent profiles, and shell execution are preserved. Plugin or client tools that share the scheduler name retain ordinary catalog ranking.

Why This Change Was Made

Tool ownership and admission are already established when Code Mode builds its index. Using those facts preserves independent-profile CLI use and gives same-named plugins their ordinary ranking.

Evidence

A scripted agent chose the visible scheduler when present, otherwise shell exec. Both runs used the same 154-tool catalog, Linux x86-64 host, reminder name, scheduled time and payload. The Gateway, CLI, scheduling tool, and state store were real.

Case Matching jobs saved Matching job ID returned to agent CLI starts CLI peak RSS
Main baseline 1 yes 1 210,480 KiB
This change 1 yes 0 no child
Explicit shell to independent --profile dev Gateway 1 in that profile, 0 in the primary yes 1 210,668 KiB

RSS covers the CLI child that successfully executed automations create. The same scripted tool-selection rule ran against each catalog. Provider-specific selection rates and arm64 container memory remain open.

The packaged build passed. The final regression failed against the frozen baseline on native-scheduler priority. All 9 tests in the changed suite passed on the published tree, including learned ranking, ordinary plugin ranking and the absent-scheduler control. Local autoreview of 4986dd0c31cac5d92c7692651bd7ae688536965b through P2 returned no actionable findings. The production diff is +5/−3 lines; the remaining changes are regression tests.

Remaining scope

Restart recovery can still report that a rejected or unacknowledged reminder was saved. This change addresses tool discovery and child-process cost. The paired restart results and the outstanding arm64 container OOM are tracked on the issue.

@clawsweeper

clawsweeper Bot commented Oct 29, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T06:06:44.580439Z
We couldn’t complete this review. Comment @codex review to try again.
ab1085f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 29, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prioritizes the admitted native scheduler in Code Mode’s bounded tool index.

Example: Schedule a reminder in the reported 154-tool Gateway session.

  • Before: The scripted agent used shell execution and started a CLI child peaking at 210,480 KiB RSS.
  • After: The native scheduler remained visible, saved one reminder, and required no CLI child.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A minimal, supported repair with relevant runtime evidence and no actionable findings; overall scope remains partial relative to the linked issue.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Linux/x86-64 Gateway run exercises the changed catalog with real scheduling, CLI, and storage: the same scripted selection saves one reminder in both arms, removes the CLI child after the fix, and preserves independent-profile execution; it does not establish provider-specific selection rates or resolve the arm64 OOM report.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: In crowded Code Mode sessions, the native scheduling signature can disappear while shell execution remains visible, encouraging an unnecessary CLI process for a reminder.
Reason: The maintainer-supported revision repairs one concrete discovery failure with the existing owner and explicitly leaves the broader recovery report open.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, maintainer-supported catalog repair, and the earlier command-blocking findings are resolved.

Reviewed head: 4986dd0c31cac5d92c7692651bd7ae688536965b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Code Mode converts admitted tool descriptors into a bounded model-facing index; tool execution continues through the existing catalog and authorization owners.

flowchart TD
  A[Admitted tools] --> B[Ownership descriptors]
  B --> C[Code Mode bindings]
  C --> D[Bounded catalog index]
  D --> E[Agent tool selection]
  E --> F[Existing tool execution]
Loading

Technical review

Best possible solution:

Land the narrow catalog-priority repair after required CI succeeds, while keeping restart recovery tracked separately.

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

Current-main source permits the scheduler to fall behind a crowded declared-output tier, and the supplied paired Gateway run demonstrates the resulting CLI selection; no target code was executed during this review.

Is this the best way to solve the issue?

The existing index owner can fix discovery with one priority-predicate extension while preserving the character budget, plugin ownership, learned ranking, and independent shell execution.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Core catalog priority keeps the original intent (d794f3d: Keep core file and shell signatures visible so catalog growth cannot hide their argument contracts.)
  • Learned index selection keeps the original intent (8a328bf: Prioritize learned tool usage within a bounded index while preserving protected core entries and canonical rendering order.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d794f3d adds src/agents/code-mode.ts:98 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d794f3d9b248; files: src/agents/code-mode.ts)
  • Josh Lehman: Raw commit 8a328bf adds src/agents/code-mode.ts:146 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8a328bf86189; files: src/agents/code-mode.ts)
  • Vincent Koc: Raw commit 3df082c adds src/agents/code-mode.ts:45 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3df082cf325b; files: src/agents/code-mode.ts)

PR surface

Source +2, Tests +38. Total +40 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 3 +2
Tests 1 38 0 +38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 43 3 +40

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 (2 earlier review cycles)
  • reviewed 2026-10-29T06:19:46.675Z sha ab1085f :: needs real behavior proof before merge. :: [P1] Preserve CLI execution outside the affected Gateway context | [P2] Parse root options before identifying the CLI subcommand | [P2] Use the message tool's actual text argument
  • reviewed 2026-10-29T15:30:18.995Z sha 070d0fe :: needs real behavior proof before merge. :: [P2] Keep host optional for the existing SQLite preflight caller | [P1] Preserve commands targeting independent profiles and Gateways

Reviewed November 25, 2026, 11:17 PM ET / November 26, 2026, 04:17 UTC (Revision 3).

@fonchaves

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 1, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

@vincentkoc

vincentkoc commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

@clawsweeper re-review

Please review the current contributor head 4986dd0c31cac5d92c7692651bd7ae688536965b. The revision keeps the admitted native scheduler in the bounded catalog and preserves independent-profile shell execution. The PR evidence includes a real two-Gateway control, the paired process measurement, the red/green regression and the exact-commit reviewer result.

@fonchaves, I updated your branch in place and retained all six contributor commits. The restart recovery reproduction remains open separately.

Resolve the contributor branch onto the current catalog owner. Preserve shell access for independently targeted Gateways and profiles.
…atalogs

Prioritize the admitted core scheduler alongside the shell and file tools. Keep plugin tools under their normal catalog ranking and preserve independent CLI profiles.

Co-authored-by: Leandro F. Chaves <[email protected]>
@vincentkoc vincentkoc changed the title fix(agent): block direct openclaw cli state mutation in exec and prioritize messaging tools in code mode fix: keep reminder scheduling visible in crowded Code Mode sessions Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@vincentkoc
vincentkoc merged commit f76b87b into openclaw:main Nov 26, 2026
141 of 144 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…penclaw#187392)

* fix(agent): block direct openclaw cli state mutation in exec and prioritize messaging tools in code mode

* fix(agent): scope openclaw cli footgun guard to gateway host and support root options

* fix(infra): allow optional host in rejectUnsafeExecLiveStateSqliteShellCommand context

* fix(lint): rename shadowed path identifier and apply project formatting

* fix(agents): keep the native scheduler visible in crowded Code Mode catalogs

Prioritize the admitted core scheduler alongside the shell and file tools. Keep plugin tools under their normal catalog ranking and preserve independent CLI profiles.

Co-authored-by: Leandro F. Chaves <[email protected]>

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Leandro F. Chaves <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…187392)

* fix(agent): block direct openclaw cli state mutation in exec and prioritize messaging tools in code mode

* fix(agent): scope openclaw cli footgun guard to gateway host and support root options

* fix(infra): allow optional host in rejectUnsafeExecLiveStateSqliteShellCommand context

* fix(lint): rename shadowed path identifier and apply project formatting

* fix(agents): keep the native scheduler visible in crowded Code Mode catalogs

Prioritize the admitted core scheduler alongside the shell and file tools. Keep plugin tools under their normal catalog ranking and preserve independent CLI profiles.

Co-authored-by: Leandro F. Chaves <[email protected]>

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Leandro F. Chaves <[email protected]>
(cherry picked from commit f76b87b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S stale Marked as stale due to inactivity 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.

2 participants