Skip to content

test(agents): derive prompt handle identity from fixture - #134094

Merged
steipete merged 2 commits into
mainfrom
codex/test-prepared-prompt-fixture
Aug 31, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-prepared-prompt-fixture

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The sandbox-policy prompt fixture repeats the provider and model ID when supplying its prepared runtime handle. Changing one copy can silently trigger unrelated provider discovery instead of exercising only the intended sandbox-policy behavior.

Why This Change Was Made

Give the attempt one fixture object and derive both handle identity fields from it, matching the existing permission-prompt fixture. The sandbox-policy assertions stay unchanged.

User Impact

No runtime behavior change. This consolidates test identity ownership so the attempt and handle cannot drift. Production +0/-0; tests +12/-11. Current main already supplies the model ID, so this PR makes no additional timing claim against current main.

Evidence

node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt-system-prompt.test.ts
{"numPassedTests":12,"numFailedTests":0,"numPendingTests":0,"success":true}

The refreshed candidate passes all prompt fixture cases after merging current main and resolving the overlapping handle-identity edit. The full embedded configuration suite previously passed 105 files and 1,467 tests with this fixture shape. Full changed-file validation passed before the refresh; formatting, diff checks, focused execution and structured Codex autoreview cover the refreshed candidate. Exact-head CI is required before landing.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 31, 2026 12:18
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 9:30 AM ET / 13:30 UTC.

ClawSweeper review

What this changes

The PR creates one prepared attempt fixture and derives the provider-runtime handle’s provider and model ID from it in an embedded-agent prompt test.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This is a focused, behavior-neutral test-fixture cleanup that current main does not yet contain; it removes a second source of provider identity without changing the sandbox-policy assertions.

Priority: P3
Reviewed head: d04bf59b239905dcdc5a4955c4291a4e008840ae

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, coherent test-only cleanup with focused validation and no correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR changes only a test fixture and no production behavior; the supplied focused test result is appropriate supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR changes only a test fixture and no production behavior; the supplied focused test result is appropriate supplemental validation.
Evidence reviewed 6 items Introduced fixture consolidation: The verified PR delta extracts the attempt object and derives both runtime-handle identity fields from it; its assertions are unchanged.
Production owner and caller: Prompt preparation consumes the supplied runtime handle for provider reasoning and prompt contributions, while the embedded attempt runner supplies that handle to the preparation owner.
Existing sibling pattern: The permission-prompt fixture already owns the attempt once and derives the same two handle fields, so this change aligns the sandbox-policy fixture with the established local pattern.
Findings None None.
Security None None.

How this fits together

Embedded agent runs prepare a system prompt from a prepared attempt and provider runtime handle. This test exercises sandbox-policy reporting while avoiding unrelated provider-identity drift in its fixture.

flowchart LR
  A[Test fixture] --> B[Prepared attempt]
  B --> C[Provider runtime handle]
  C --> D[Prompt preparation]
  D --> E[Sandbox-policy report assertions]
Loading

Before merge

  • Complete next step (P2) - The branch already contains the focused repair; routine maintainer review and exact-head CI remain the appropriate path.
Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +12/-11 (net +1) The sole change reorganizes one test fixture; it adds no runtime, configuration, or compatibility surface.

Technical review

Best possible solution:

Use the prepared attempt as the single fixture owner for provider and model identity, preserving the existing sandbox-policy coverage.

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

Not applicable: this PR reorganizes a test fixture rather than reporting a runtime defect.

Is this the best way to solve the issue?

Yes. Aligning this fixture with the existing local single-attempt pattern removes duplicated identity ownership without altering production behavior or test expectations.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P3: This is a low-risk test maintainability improvement with no user-visible runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR changes only a test fixture and no production behavior; the supplied focused test result is appropriate supplemental validation.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-31T12:26:30.169Z sha 6ee85eb :: needs maintainer review before merge. :: none

@steipete steipete changed the title test(agents): reuse prepared provider identity in prompt fixtures test(agents): derive prompt handle identity from fixture Aug 31, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI passed for d04bf59b239905dcdc5a4955c4291a4e008840ae: run 33396812791 completed successfully with 124 successful jobs and 18 skipped jobs. The required openclaw/ci-gate is SUCCESS.

The current ClawSweeper review covers the same head and reports no actionable findings or Rank-up moves. The focused prompt-fixture result already recorded in the PR body is 12 passed, zero failed; this PR derives provider/model identity from the single attempt fixture while preserving the sandbox-policy assertions. Production remains unchanged.

@steipete
steipete merged commit add7975 into main Aug 31, 2026
197 of 199 checks passed
@steipete
steipete deleted the codex/test-prepared-prompt-fixture branch August 31, 2026 14:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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