Skip to content

fix(agents): broaden local model lean profile#87617

Closed
vincentkoc wants to merge 1 commit into
mainfrom
codex/small-model-lean-profiles
Closed

fix(agents): broaden local model lean profile#87617
vincentkoc wants to merge 1 commit into
mainfrom
codex/small-model-lean-profiles

Conversation

@vincentkoc

@vincentkoc vincentkoc commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Broaden localModelLean so small/local models avoid heavyweight web, media, session orchestration, node, channel, and subagent tool families.
  • Keep core coding/status tools available in lean mode and cover the retained/trimmed surface with focused tests.
  • Refresh config help and local-model docs so the operator-facing contract matches the broader lean profile.

Verification

  • git diff --check origin/main...HEAD
  • node scripts/format-docs.mjs --check docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md
  • node scripts/check-docs-mdx.mjs docs/concepts/experimental-features.md docs/gateway/local-models.md docs/providers/ollama.md
  • ./node_modules/.bin/oxfmt --check --threads=1 src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/agent-tools.model-provider-collision.test.ts src/config/schema.help.ts
  • ./node_modules/.bin/oxlint src/agents/local-model-lean.ts src/agents/local-model-lean.test.ts src/agents/agent-tools.model-provider-collision.test.ts src/config/schema.help.ts
  • node scripts/run-vitest.mjs src/agents/local-model-lean.test.ts src/agents/agent-tools.model-provider-collision.test.ts src/config/schema.help.quality.test.ts src/config/schema.hints.test.ts src/config/plugins-runtime-boundary.test.ts - 5 files / 55 tests passed.
  • node scripts/run-vitest.mjs src/agents/sessions/extensions/loader.test.ts - 2 files / 4 tests passed, covering the previously failed checks-node-agentic-agents loader surface.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main - clean, no accepted/actionable findings.
  • AWS Crabbox check:changed: provider aws, lease cbx_e10934f873f7, slug harbor-shrimp, run run_3cdcf7eb920b, exit 0, cleanup leaseStopped=true.

Rebase note

The previous checks-node-agentic-agents failure was stale-base drift around @openclaw/net-policy/ip resolution in src/agents/sessions/extensions/loader.test.ts, not this PR's lean-profile diff. Rebased onto origin/main 8c0aaee88237e3ac98c63df222c3762972b8a92e; the exact loader test and the AWS Crabbox changed gate now pass.

Real behavior proof

Behavior addressed: localModelLean previously trimmed only browser, cron, and message, which left many large web/media/channel/orchestration schemas visible to smaller local models.
Real environment tested: AWS Crabbox Linux runner, provider aws, lease cbx_e10934f873f7, run run_3cdcf7eb920b, branch head 23e8dabab06c6367aab951b8ceab7917fed99781, changed gate from base 8c0aaee88237e3ac98c63df222c3762972b8a92e.
Exact steps or command run after this patch: rebased the branch to current main, kept the diff to the 7 intended lean-profile files, checked docs/format/lint, ran the focused lean/profile/config Vitest set locally, ran the previously failing loader test locally, ran autoreview, and ran remote pnpm check:changed through AWS Crabbox.
Evidence after fix: Crabbox changed gate completed with exit 0; focused local Vitest reported 5 files / 55 tests passed; loader test reported 2 files / 4 tests passed; autoreview reported no accepted/actionable findings; docs formatter and MDX checks passed.
Observed result after fix: lean mode keeps read, write, edit, exec, apply_patch, process, session_status, and update_plan, while trimming heavyweight browser/web/media/channel/session/subagent surfaces.
What was not tested: live Ollama or hosted-provider calls in this PR; this PR changes local lean tool visibility and validates the changed code/docs paths.

Related: #86599

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 24, 2026, 4:13 PM ET / 20:13 UTC.

Summary
The PR expands localModelLean from a three-tool trim to broader web, media, channel, session, node, orchestration, and hosted-code tool filtering, with matching docs/help/test updates.

PR surface: Source +24, Tests +55, Docs +7. Total +86 across 7 files.

Reproducibility: yes. for the review findings: current source and the PR diff show the existing three-tool lean contract and the PR's broadened deny set under the same flag. No live local-model run is needed to reproduce that compatibility change.

Review metrics: 2 noteworthy metrics.

  • Lean deny-list expansion: 3 -> 23 denied tool names. This quantifies the compatibility-sensitive behavior change hidden behind an existing experimental boolean.
  • Config behavior surface: 0 added, 1 changed, 0 removed. The PR changes semantics for the already-shipped localModelLean default and per-agent override instead of adding a new opt-in knob.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🐚 platinum hermit
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Move the broad deny set behind a strict opt-in profile or record maintainer acceptance of the compatibility break.
  • Rebase against current main while preserving lean Tool Search defaults and delivery-tool preservation.
  • Align the explicit docs list with the final runtime deny/allow contract.

Risk before merge

  • [P1] Existing users with localModelLean: true would lose broad web, media, session/orchestration, gateway/node, image, and code-execution tools through the same existing boolean unless maintainers explicitly accept that upgrade behavior.
  • [P1] Removing channel/session/orchestration tools can affect direct delivery or spawned-session workflows, especially because current main now has preservation paths for required delivery tools and Tool Search controls.
  • [P1] The safer strict-profile replacement direction is still draft and conflicting, so it should not be treated as a merged superseding implementation.

Maintainer options:

  1. Move broad trim behind strict opt-in (recommended)
    Preserve the existing localModelLean: true behavior and put the larger deny set behind a strict profile or equivalent explicit operator opt-in.
  2. Accept the experimental behavior break
    Maintainers can intentionally redefine the existing experimental boolean, but the PR should document upgrade impact and prove fresh-install plus existing-config behavior.
  3. Pause for the strict-profile lane
    If the strict-profile PR is the desired product direction, pause this branch until that replacement is merged or explicitly rejected.

Next step before merge

  • [P2] Manual review is needed because this protected maintainer PR changes existing experimental config semantics and overlaps with unresolved strict-profile work.

Security
Cleared: The diff changes agent tool filtering, tests, docs, and config help only; no concrete security or supply-chain concern was found.

Review findings

  • [P1] Preserve basic lean mode behind a strict opt-in — src/agents/local-model-lean.ts:6-30
  • [P3] Include sessions_yield in the explicit docs list — docs/concepts/experimental-features.md:40
Review details

Best possible solution:

Keep current basic lean behavior for existing configs, and land the broader trim only behind an explicit strict opt-in profile or after maintainer-approved upgrade-break documentation and proof.

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

Yes for the review findings: current source and the PR diff show the existing three-tool lean contract and the PR's broadened deny set under the same flag. No live local-model run is needed to reproduce that compatibility change.

Is this the best way to solve the issue?

No. Broadening the existing boolean is a plausible mitigation, but the safer maintainable solution is an explicit strict opt-in profile or a clearly documented maintainer-approved compatibility break.

Full review comments:

  • [P1] Preserve basic lean mode behind a strict opt-in — src/agents/local-model-lean.ts:6-30
    This expands the existing localModelLean boolean from the current three denied tools to a broad deny set that removes web, media, session/agent, gateway/node, image, and code-execution tools for every upgraded user who already enabled the flag. Keep the current basic behavior and put this larger trim behind an explicit strict profile, or document and approve the compatibility break before merge.
    Confidence: 0.91
  • [P3] Include sessions_yield in the explicit docs list — docs/concepts/experimental-features.md:40
    The docs enumerate trimmed session/orchestration tools but omit sessions_yield, even though the new deny set removes it. If this explicit list remains, it needs to match the runtime contract so operators can predict which tools disappear.
    Confidence: 0.8

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f0f5da0e3941.

Label changes

Label justifications:

  • P2: This is a bounded agent/tool-surface change, but it affects existing local-model operator behavior and needs maintainer direction.
  • merge-risk: 🚨 compatibility: The PR changes the semantics of an existing experimental config flag and can remove tools from upgraded users without a new opt-in.
  • merge-risk: 🚨 message-delivery: The expanded deny set covers channel/session/orchestration tools, so existing lean-mode communication flows can lose direct tool access unless preserved carefully.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The external-contributor proof gate does not apply to this maintainer-labeled member PR, though the body reports focused tests and AWS Crabbox changed-gate proof.
Evidence reviewed

PR surface:

Source +24, Tests +55, Docs +7. Total +86 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 27 3 +24
Tests 2 55 0 +55
Docs 3 14 7 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 96 10 +86

What I checked:

  • Current main lean contract: Current main still denies only browser, cron, and message for localModelLean, with Tool Search defaults layered separately. (src/agents/local-model-lean.ts:12, f0f5da0e3941)
  • Current main delivery preservation: Current main passes localModelLeanPreserveToolNames into lean filtering so required runtime/delivery tools can survive the lean policy. (src/agents/agent-tools.ts:284, f0f5da0e3941)
  • PR broadens the same boolean: The PR changes the existing deny set to 23 tool names under the same localModelLean boolean, including web, media, session/orchestration, gateway/node, image, and code-execution surfaces. (src/agents/local-model-lean.ts:6, e66d7c6713ea)
  • Docs list mismatch: The PR runtime deny set removes sessions_yield, but the new explicit docs list omits it from the channel/session/orchestration tools it says lean mode trims. Public docs: docs/concepts/experimental-features.md. (docs/concepts/experimental-features.md:40, e66d7c6713ea)
  • Strict-profile related PR is not canonical yet: The related strict-profile PR keeps basic lean behavior by adding an opt-in profile, but it is draft and currently conflicting, so it cannot safely supersede this PR. (10239eb74ee3)
  • Feature history: Lean mode was introduced by merged PR history, then per-agent behavior and later Tool Search/default preservation were added in later area work. (src/agents/local-model-lean.ts, 13c97c5a8d04)

Likely related people:

  • vincentkoc: Recent main history compacted lean local tool catalogs and the same person owns this PR and related strict-profile/media-trim lean work. (role: recent area contributor; confidence: high; commits: 8b03fd1f5f83, e66d7c6713ea; files: src/agents/local-model-lean.ts, src/agents/embedded-agent-runner/run/attempt.ts, docs/concepts/experimental-features.md)
  • dutifulbob: Merged PR history for per-agent localModelLean added the current local-model lean module and tests. (role: introduced per-agent behavior; confidence: high; commits: 13c97c5a8d04; files: src/agents/local-model-lean.ts, src/agents/local-model-lean.test.ts, src/config/schema.help.ts)
  • ImLukeF: Merged PR history introduced lean local model mode and the first three-tool lean contract. (role: original feature author; confidence: medium; commits: 4015138df93e; files: docs/gateway/local-models.md, src/config/schema.help.ts, src/config/types.agent-defaults.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg: ✨ hatched 🥚 common Tiny Branchling. Rarity: 🥚 common. Trait: polishes edge cases.

Details

Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Tiny Branchling in ClawSweeper.
Hatchability:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

About:

  • Eggs appear after real-behavior proof passes. They are collectible flavor only.
  • Review momentum changes the shell state: follow-up work warms it, re-review makes it wobble, and a clean final review lets it hatch.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@vincentkoc vincentkoc self-assigned this May 28, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from 1c0a50b to e6fe146 Compare May 28, 2026 17:28
@clawsweeper clawsweeper Bot added 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. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 28, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from e6fe146 to 5de7591 Compare May 28, 2026 18:24
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 28, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from 5de7591 to 7f1c188 Compare May 28, 2026 19:24
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 28, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from 7f1c188 to d1ad46e Compare May 28, 2026 19:53
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels May 28, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Verification refresh after rebase onto 9cb4e48018:

  • AWS Crabbox corepack pnpm check:changed: run_eede8a5575ca, lease cbx_aca86fe12c24, provider aws, exit 0.
  • Branch head: d1ad46eaf6f3ecc90046618d4e21802689f5b3d3.

Blacksmith Testbox is still unavailable on this machine because blacksmith auth login is required, so this used direct AWS Crabbox remote proof.

@vincentkoc
vincentkoc marked this pull request as ready for review May 28, 2026 20:04
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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 May 29, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch 2 times, most recently from 5aa1b3b to 8a0d598 Compare May 29, 2026 09:08
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 29, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from 8a0d598 to f3ff929 Compare May 29, 2026 09:16
@clawsweeper clawsweeper Bot added 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. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch 2 times, most recently from 04d5691 to 23e8dab Compare May 29, 2026 16:39
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch 2 times, most recently from 51cde35 to 52d8aca Compare May 29, 2026 17:22
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@vincentkoc
vincentkoc force-pushed the codex/small-model-lean-profiles branch from 52d8aca to e66d7c6 Compare May 29, 2026 17:50
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 15, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closing this stale branch. It broadens the meaning of existing localModelLean: true configs by silently removing web, node, channel, session, and subagent tool families after upgrade. Current main deliberately keeps a narrower canonical lean contract, trims the highest-cost optional tools, and preserves explicit operator choices through Tool Search and allowlists.

Broader trimming should be a separate opt-in contract with live provider proof, not an in-place expansion of the shipped boolean. Thanks for the work and verification.

@steipete steipete closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants