Skip to content

fix(decisions): skip prefilter inference for empty tool baselines - #174269

Merged
vincentkoc merged 1 commit into
mainfrom
fix/decision-empty-tool-prefilter-20261016
Oct 16, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/decision-empty-tool-prefilter-20261016

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The automatic Decision prefilter can run when the prepared permission baseline has no tools, even though there is nothing for it to restrict.

User Impact

Empty tool baselines skip optional model evaluation and record no-tools. Later turns with available tools still evaluate normally, and client-only tools remain eligible.

Why This Change Was Made

Read the canonical tool-policy baseline after preparation awaits, not the previous turn's pruned model-facing surface. Existing hook and pending-action precedence stays unchanged. Both embedded and worker prompt assembly supply the current baseline fact.

No configuration, model route, pruning threshold, or public SDK option changes. Promoted onto merged #174013 at 3431d6ad4374168ab646042a6be38b47ea49f48e; this child adds only the empty-baseline guard and its caller/test wiring.

Evidence

  • Current head: a2e2332490fa783f632416a471dd0b4f4fdef381. Root independently verified the patch-identical promotion; all nine child files match reviewed e5f7e25f3ab8ffc92e4e3726b7c2315ebb6868ac. Source and independent review are clean.
  • Exact-head CI https://github.com/openclaw/openclaw/actions/runs/38916278230 succeeded with 51 successful and 26 skipped jobs. Root/source-owner evidence verifies Decision 23, provenance 6, phase 16, and paired node-worker lifecycle 2/2 tests passed. Gate job 117030582109 succeeded.
  • Coverage includes an empty baseline, next-turn evaluation after previous full pruning, permission-generation changes during preparation, and client-only model tools. Lander inspected the full child diff, baseline owner, guard ordering, and embedded/worker wiring.
  • Previous-head CI was not fully green: paired node-worker lifecycle failed on retention/placement observations before Decision dispatch. That old failure remains unattributed, not relabeled pre-existing. Normal parent promotion incorporated the existing lifecycle fixture/retention repairs from fix(update): return partial status when inspections stall #174060 and fix(subagents): restore requester authority after Gateway restarts #173873; the current integration now passes that path. No unrelated repair was cherry-picked.
  • Production delta: +8 lines; tests and fixtures: +85 lines. The callback carries an existing canonical permission fact without rediscovering tools or treating a previous Decision restriction as authority.
  • No live-provider cost or latency benchmark is claimed.

@vincentkoc vincentkoc self-assigned this Oct 16, 2026
@clawsweeper

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

@vincentkoc
vincentkoc marked this pull request as ready for review October 16, 2026 13:50
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Skip automatic Decision inference when the prepared permission baseline contains no tools.

Example: Decision assistance is enabled, the prompt is "Hello", disableTools is unset, and the prepared tool baseline is [].

  • Before: The optional Decision provider can receive an evaluation request despite having no tools to restrict.
  • After: Prompt assembly skips evaluation and records reason "no-tools".

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused patch with no identified introduced defect; validation remains limited by the unresolved exact-head CI failure.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal guard is outside the ordinary contributor proof gate and does not materially change authority; supplied coverage uses production assembly and policy with a registered fixture provider.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An opted-in turn can pay for optional Decision evaluation when no tools exist for its result to restrict.
Reason: The maintainer-authored direction removes useless provider work through a narrow internal change with no new setting or public contract.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it addresses a current-main inference gap without an identified introduced defect, but the exact-head CI gate is red and its failure remains unattributed.

Priority: P2
Reviewed head: e5f7e25f3ab8ffc92e4e3726b7c2315ebb6868ac

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: A failing-base/passing-head execution of the new empty-baseline regression is not supplied.
Agent review details

How this fits together

Embedded and worker prompt assembly combine prepared tool capabilities, hook policy, and optional Decision results before submitting the foreground model request.

flowchart TD
  A[Prepared tool baseline] --> B[Prompt assembly guards]
  C[Hooks and steering] --> B
  B --> D[Optional Decision evaluation]
  B --> E[Existing tool policy owner]
  D --> E
  E --> F[Foreground model request]
Loading

Technical review

Best possible solution:

Keep the empty-baseline check at shared prompt assembly and derive its input from the existing tool-policy owner.

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

Current-main source permits an eligible, tools-enabled user turn with an empty prepared baseline to reach provider evaluation; no runtime reproduction was performed during this read-only review.

Is this the best way to solve the issue?

The focused guard addresses the unnecessary request while preserving hook precedence, client capabilities, and later-turn restoration without adding another policy owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Mert Başar: Raw commit 2f1f8be adds src/agents/embedded-agent-runner/run/attempt-prompt-build.ts:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2f1f8beed7a3; files: src/agents/embedded-agent-runner/run/attempt-prompt-build.ts)
  • Peter Steinberger: Raw commit 67433ff adds src/agents/embedded-agent-runner/run/attempt-prompt-support.ts:57 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 67433ff43813; files: src/agents/embedded-agent-runner/run/attempt-prompt-support.ts)

PR surface

Source +8, Tests +85. Total +93 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 9 1 +8
Tests 5 98 13 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 107 14 +93

Review metrics

Metric Value Why it matters
Production versus test growth Production net +8 lines; tests and fixtures net +85 lines. The small production guard reuses existing ownership; test growth covers the empty case and three distinct preservation contracts.

Labels

Label changes:

  • add P2: Unnecessary optional inference can add provider work and foreground delay for opted-in turns with empty tool baselines.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Unnecessary optional inference can add provider work and foreground delay for opted-in turns with empty tool baselines.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Have the CI owner attribute the paired-node retention failure before landing.

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.

Reviewed October 16, 2026, 10:07 AM ET / 14:07 UTC.

Base automatically changed from fix/decision-prefilter-effect-diagnostics-20261016 to main October 16, 2026 14:22
@vincentkoc
vincentkoc force-pushed the fix/decision-empty-tool-prefilter-20261016 branch from e5f7e25 to a2e2332 Compare October 16, 2026 14:30
@vincentkoc
vincentkoc merged commit cd3f93b into main Oct 16, 2026
143 checks passed
@vincentkoc
vincentkoc deleted the fix/decision-empty-tool-prefilter-20261016 branch October 16, 2026 16:48
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'a4c73619a5c': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…157433

* commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…/decision-onnx-v2-proof-20261016

* commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…ision-accounting-native

* commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…158510

* commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…esafe-decision-native

* commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…/decision-tool-v2-proof-20261016

* commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits)
  test: align model and Discord fixtures with runtime owners
  perf(sessions): reuse startup deletion discovery (#174408)
  fix(gateway): attribute ephemeral connections in normal logs (#174406)
  test(telegram): consolidate duplicate coverage (batch d117) (#173112)
  perf(doctor): avoid redundant backup and transcript reads (#174416)
  fix(update): avoid redundant reads for closed SQLite generations (#174426)
  fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856)
  fix(decisions): skip prefilter for empty tool surfaces (#174269)
  perf(sqlite): retain unchanged database proofs across schema updates (#174409)
  refactor(test): remove duplicate export collision checks (#174391)
  fix: clear unused MCP and identity helper exports (#174421)
  fix(test): supply SQLite reliability fixture catalog
  refactor(mattermost): use the guarded transport directly (#174419)
  refactor(agents): trust prepared provider facts (#174388)
  fix(control-ui): open submenus immediately on click (#174292)
  test(anthropic): synchronize the late-send fixture with initialization
  refactor(ui): scope Plugins page state to Solid owners (#174281)
  perf(chat): pace board history refreshes and reuse cursors (#174407)
  perf(sqlite): bound session receipt scope publication (#174395)
  refactor(openrouter): share key budget test fixtures (#174340)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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