Skip to content

fix: clarify bootstrap setup versus prompt injection - #118568

Closed
qingminglong wants to merge 5 commits into
openclaw:mainfrom
qingminglong:issue-75184-config-help
Closed

qingminglong wants to merge 5 commits into
openclaw:mainfrom
qingminglong:issue-75184-config-help

Conversation

@qingminglong

@qingminglong qingminglong commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #75184

What Problem This Solves

Fixes an issue where users who set agents.defaults.skipBootstrap: true could reasonably expect workspace bootstrap files to stop affecting agent prompts, while the configuration help did not explain that this setting only controls file creation or point to the existing prompt-injection control.

Why This Change Was Made

Clarify the existing configuration boundary in schema help and gateway documentation: skipBootstrap controls workspace file creation, while contextInjection: "never" controls prompt-time workspace and context-file injection. The configuration shape remains unchanged, and CLI-run preparation now honors the existing prompt-injection control.

User Impact

Operators can now choose the correct setting for bootstrap-file creation versus prompt injection without relying on trial and error.

Evidence

  • Exact-head production-path CLI preparation proof on 1e20508b1822867ed73a77700f5db86ec699d447: node --import tsx --input-type=module - invoked prepareCliRunContext with the repository test CLI backend and a temporary workspace containing AGENTS.md; the bootstrap resolver was not mocked.

    Redacted inspectable output:

    {"mode":"always","injectedWorkspaceFiles":[{"name":"AGENTS.md","missing":false,"injectedChars":32,"truncated":false}],"promptContainsBootstrapText":true}
    {"mode":"never","injectedWorkspaceFiles":[],"promptContainsBootstrapText":false}
    

    The always control confirms the real workspace file is discoverable and injected, while never suppresses both the file list and its prompt content.

  • Exact-head CLI config-schema proof: pnpm openclaw config schema --json returned exit 0 and exposed skipBootstrap as file-creation-only plus contextInjection values always, continuation-skip, and never, including the per-agent override.

  • Supporting checks on the same head: focused regression test passed (Test Files 1 passed, Tests 1 passed | 104 skipped (105)); targeted oxfmt --check passed for 11 changed source files; git diff --check passed.

  • Proof boundary: the production-path harness proves CLI preparation with a temporary workspace and repository test backend, and the schema CLI proves the exported configuration contract. It does not claim behavior for external providers, private credentials, or devices.

  • Exact PR head: 1e20508b1822867ed73a77700f5db86ec699d447.
    AI-assisted: Codex.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: XS labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 20, 2026, 2:50 PM ET / 18:50 UTC.

ClawSweeper review

What this changes

The PR clarifies bootstrap-file creation versus prompt injection and makes the existing contextInjection: "never" setting suppress OpenClaw-managed workspace context in CLI, Codex, and Copilot preparation.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep open: the PR addresses a current cross-runtime inconsistency, but it is merge-dirty and exposes an undocumented public SDK resolver; it needs a current-main rebase and maintainer confirmation of the upgrade-visible behavior.

Priority: P2
Reviewed head: 1e20508b1822867ed73a77700f5db86ec699d447
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The supplied behavior proof is credible, but the stale conflict and undocumented SDK expansion prevent merge readiness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body provides exact-head terminal output from real CLI preparation with a temporary workspace, showing never removes OpenClaw-managed context; refresh it after rebase and redact any private paths or configuration.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides exact-head terminal output from real CLI preparation with a temporary workspace, showing never removes OpenClaw-managed context; refresh it after rebase and redact any private paths or configuration.
Evidence reviewed 6 items Current-main config contract: Current main accepts contextInjection: "never" and resolves it per agent, establishing an existing configuration contract rather than a new option.
Current-main inconsistency: The embedded runner already avoids bootstrap loading for never, while current-main CLI preparation calls the resolver without a context-injection guard.
Current native-harness boundary: Current main's Codex path separately represents native project documents and inherited agent-workspace instructions, so the branch must be rebased through this newer projection before merge.
Findings 1 actionable finding [P2] Document the new public SDK resolver
Security None None.

Live Verification

Command: pnpm openclaw config schema --json

Result: FAIL (failed) — execution before step 1 run: live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

Assertions:

  • FAIL expect_output: contextInjection

How this fits together

Agent configuration determines whether OpenClaw loads workspace bootstrap files into prompts. CLI and native harnesses prepare those prompts differently before sending an agent turn to their respective runtimes.

flowchart LR
  Config[Agent configuration] --> Mode[Context injection mode]
  Mode -->|always or continuation| Bootstrap[Load workspace context]
  Mode -->|never| Empty[Use empty OpenClaw context]
  Bootstrap --> Prompts[CLI and native harness prompts]
  Empty --> Prompts
  Prompts --> Turn[Agent turn]
Loading

Decision needed

Question Recommendation
Should contextInjection: "never" now be a cross-runtime upgrade-visible guarantee for CLI, Codex, and Copilot, with a supported public SDK resolver? Confirm and rebase the contract: Rebase the PR through current Codex projection code, document the SDK helper, and prove suppression of OpenClaw-managed context while preserving native loader boundaries.

Why: The setting is already valid configuration and current main has newer Codex prompt-projection behavior, so the compatibility contract cannot be selected mechanically.

Before merge

  • Document the new public SDK resolver (P2) - This re-export makes context-injection resolution part of openclaw/plugin-sdk/agent-harness-runtime, but the SDK docs do not define its supported contract. Document the resolver and its agent-override semantics, or keep the helper bundled-only so external plugins do not adopt an accidental API.
  • Resolve merge risk (P1) - contextInjection: "never" is already accepted configuration, so extending its suppression to CLI, Codex, and Copilot changes existing operators' prompt behavior on upgrade.
  • Resolve merge risk (P1) - The branch is merge-dirty and predates current main's Codex native-document and inherited-workspace projection; its proof must be refreshed after a conflict-aware rebase.
  • Complete next step (P2) - A maintainer must confirm the upgrade contract and the branch needs conflict-aware rebase work against current Codex prompt projection.

Findings

  • [P2] Document the new public SDK resolver — src/plugin-sdk/agent-harness-runtime.ts:444
Agent review details

Security

None.

PR surface

Source +23, Tests +71, Docs 0, Other +2. Total +96 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 40 17 +23
Tests 3 71 0 +71
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 2 +2
Total 12 117 21 +96

Review metrics

Metric Value Why it matters
Production versus test LOC production +41/-19; tests +74/-0; docs +2/-2 The net production growth implements three distinct prompt-owner guards; the rebase should confirm it remains necessary against current main.
Existing configuration behavior 0 options added; 1 existing value extended to 3 runtime paths contextInjection: "never" already validates, so its newly effective behavior is upgrade-sensitive.

Stored data model

Persistent data-model change detected: serialized state: extensions/codex/src/app-server/attempt-context.test.ts, serialized state: extensions/copilot/src/workspace-bootstrap.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #75184
Summary: This PR is the candidate implementation for the linked bootstrap-context issue; no merged replacement was established.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Rebase through native document handling (recommended)
    Carry the guard through current-main Codex workspace projection, document the public SDK helper, and refresh exact-head terminal proof before merge.
  2. Accept the changed setting semantics
    Maintainers may explicitly accept that existing contextInjection: "never" users will newly lose OpenClaw-managed context in the three repaired paths.
  3. Pause the cross-runtime expansion
    Pause this PR if maintainers do not want the existing setting to become a uniform cross-runtime contract.

Technical review

Best possible solution:

Rebase onto current main, preserve native SDK-owned document loading while suppressing only OpenClaw-managed context, document the public SDK resolver or keep it bundled-only, and refresh exact-head proof.

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

Yes—source-reproducible: current main accepts never, the embedded runner suppresses context, and CLI/Codex/Copilot still load it unconditionally.

Is this the best way to solve the issue?

No: the intended behavior is sound, but this stale branch must be integrated with current Codex native-document handling and its new public SDK contract before it is the best fix.

Full review comments:

  • [P2] Document the new public SDK resolver — src/plugin-sdk/agent-harness-runtime.ts:444
    This re-export makes context-injection resolution part of openclaw/plugin-sdk/agent-harness-runtime, but the SDK docs do not define its supported contract. Document the resolver and its agent-override semantics, or keep the helper bundled-only so external plugins do not adopt an accidental API.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded prompt-context configuration repair with an upgrade-visible effect, not a default-path outage.
  • merge-risk: 🚨 compatibility: Existing valid contextInjection: "never" configurations will change behavior in CLI, Codex, and Copilot after merge.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body provides exact-head terminal output from real CLI preparation with a temporary workspace, showing never removes OpenClaw-managed context; refresh it after rebase and redact any private paths or configuration.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head terminal output from real CLI preparation with a temporary workspace, showing never removes OpenClaw-managed context; refresh it after rebase and redact any private paths or configuration.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Recent current-main Codex work owns native project-document reporting and the shared bootstrap continuation path. (role: recent area contributor; confidence: high; commits: 491dc7f8b1be, d0b6a92f85c7; files: extensions/codex/src/app-server/attempt-context.ts, src/agents/bootstrap-files.ts)
  • Ayaan Zaidi: Recent current-main work added inherited agent-workspace instructions for native Codex subagents. (role: recent adjacent contributor; confidence: high; commits: d412c6b284e4; files: extensions/codex/src/app-server/attempt-context.ts)

Rank-up moves

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

  • Rebase through current-main Codex native-document projection and resolve conflicts intentionally.
  • Document the new public SDK resolver or remove it from the public barrel.
  • Refresh the terminal proof on the rebased exact head.

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 (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-04T06:23:28.442Z sha b4e65d1bf9717db8e21f687378281f28607520ed :: needs real behavior proof before merge. :: [P2] Honor contextInjection never in CLI preparation
  • reviewed 2026-08-04T08:17:21.814Z sha 5a40512507deece997e8b7520d2b0742b9da6b70 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-04T09:40:14.163Z sha 5a40512507deece997e8b7520d2b0742b9da6b70 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T11:40:41.177Z sha 5a40512507deece997e8b7520d2b0742b9da6b70 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T12:07:07.948Z sha 5a40512507deece997e8b7520d2b0742b9da6b70 :: needs real behavior proof before merge. :: [P1] Honor the documented setting across harnesses | [P2] Document the never enum in the exported config type
  • reviewed 2026-08-14T01:31:05.644Z sha 4c29a2906147b746bed4c24c967a61fdb80390e7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-14T03:08:08.800Z sha 1e20508 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T04:27:25.340Z sha 1e20508 :: needs maintainer review before merge. :: none

@qingminglong
qingminglong force-pushed the issue-75184-config-help branch from 4fa23e3 to eeb318f Compare August 3, 2026 09:05
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 3, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed 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. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@qingminglong
qingminglong force-pushed the issue-75184-config-help branch from eeb318f to b4e65d1 Compare August 4, 2026 06:16
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling and removed size: XS labels Aug 4, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 12, 2026
@qingminglong
qingminglong force-pushed the issue-75184-config-help branch from 5a40512 to 96996cc Compare August 13, 2026 11:39
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 14, 2026
@qingminglong
qingminglong force-pushed the issue-75184-config-help branch from 4c29a29 to 1e20508 Compare August 14, 2026 02:21
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 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 extensions: codex extensions: copilot gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. scripts Repository scripts 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.

[Bug]: agents.defaults.skipBootstrap: true is a no-op for workspace bootstrap files

1 participant