Skip to content

fix: restore prompt cache observation check after tool changes - #186233

Merged
shakkernerd merged 1 commit into
mainfrom
prompt-cache-observation-contract-609
Oct 27, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
prompt-cache-observation-contract-609

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a CI failure in the prompt-submission cache observation test when a tool description changes. Prompt-cache diagnostics now identify non-built-in tools by a bounded position, but this integration case still expected the retired raw tool name.

User Impact

There is no user-visible runtime change. The existing test once again checks the diagnostic contract that production already emits while preserving request counts, cache-read and cache-break semantics, compaction exclusion, canonical prefix observation, authority rechecks, and the privacy boundary that avoids exposing custom tool names.

Why This Change Was Made

The existing case matrix now expects the exact positional tool[1] descriptor. It remains an exact assertion rather than accepting a loose substring. This recovery-hit case intentionally does not copy the sibling drop-only facts: suffix: its immediately preceding request reported a zero cache read, so it consumes the start-of-request change detail without cache-drop fact enrichment.

Evidence

  • Scheduled CI run 40550646318, job 122353746468 failed on the retired "read" detail while production returned the bounded tool[1] form.
  • Exact candidate remote lint/format and affected type graphs passed. The complete prompt-cache observability owner suite passed 33/33, the complete prompt-submit observation file passed 2/2, and the exact-base test-line ratchet passed with 12 lines of slack.
  • Exact-head hosted security, architecture, source-contract, CodeQL, workflow-sanity, macOS-scope, and selected extension-lint checks report no failures; the remaining broad jobs are capacity-queued.
  • No model, provider, network, benchmark, or new runtime scenario is required for this test-contract repair.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 27, 2026
@shakkernerd shakkernerd self-assigned this Oct 27, 2026
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR updates the prompt-submission test to expect a positional tool descriptor instead of a raw tool name.

Example: The third observed request changes the read tool description from Read text to Read workspace text after a request with zero cached tokens.

  • Before: The test expects 1 -> 1 tools; description: "read" and rejects the current diagnostic.
  • After: The test expects 1 -> 1 tools; description: tool[1], matching production.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source-backed repair is correct and narrowly scoped; supplied execution evidence is harness-based and relevant exact-head CI remains queued.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-contract repair changes no shipped behavior; the existing harness exercises the real prompt-submission and cache-observation owners with synthetic provider output.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: A valid privacy-preserving diagnostic causes the prompt-submission integration test to fail.
Reason: The maintainer-authored repair restores useful integration coverage without changing runtime behavior or expanding scope.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it makes the smallest correct repair to a stale test expectation while preserving the intended diagnostic privacy contract; no actionable defects found.

Priority: P3
Reviewed head: eb400bf537afa12db6146c136dc519bf40a74d8b

Before merge

None.

Findings

None.

Agent review details

How this fits together

The embedded prompt runner passes foreground model-request context to the cache observer, which combines request fingerprints and usage into content-free cache diagnostics.

flowchart LR
  A[Foreground model request] --> B[Prompt submission runner]
  B --> C[Cache request observer]
  C --> D[Snapshot and tool comparison]
  E[Model usage] --> C
  D --> F[Bounded diagnostic]
  F --> G[Integration assertion]
Loading

Technical review

Best possible solution:

Retain the one-line expectation repair and complete the existing exact-head CI gates.

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

Source establishes the mismatch: fetched main expects the raw read name while the diagnostic owner produces tool[1]; no target tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: replacing the stale expected string preserves the exact contract assertion and avoids reverting the intentional privacy improvement.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Prompt-submission diagnostic expectation keeps the original intent (a3267d4: The prior test-maintenance campaign consolidated fixtures while preserving observation semantics; the raw-name expectation predates the later privacy change.)
  • Positional tool diagnostic contract keeps the original intent (fe8f3f3: The merged feature deliberately excludes arbitrary custom-tool names from diagnostic output.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fe8f3f3 adds src/agents/embedded-agent-runner/prompt-cache-facts.ts:277 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fe8f3f301832; files: src/agents/embedded-agent-runner/prompt-cache-facts.ts)

PR surface

Tests 0. Total 0 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 1 0

Labels

Label changes:

  • add P3: This is a focused test-contract repair with no production or user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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:

  • P3: This is a focused test-contract repair with no production or user-visible behavior change.
  • 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.

Reviewed October 27, 2026, 3:28 PM ET / 19:28 UTC.

@shakkernerd
shakkernerd merged commit 0c81318 into main Oct 27, 2026
125 of 126 checks passed
@shakkernerd
shakkernerd deleted the prompt-cache-observation-contract-609 branch October 27, 2026 20:13
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: the prompt-cache observation check now matches bounded positional tool diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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