docs(ai): add PowerShell instructions to the minimal chat example#108567
Conversation
60da87f to
6294d99
Compare
|
Updated the PowerShell cleanup documentation on current single-commit head The documented command uses A Windows PowerShell 5.1 one-provider cleanup probe passed, as did |
1f86b4a to
f7a47e0
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 2:16 AM ET / 06:16 UTC. Summary PR surface: Docs +17, Other -2. Total +15 across 2 files. Reproducibility: yes. Running the current POSIX-style inline environment assignment in native PowerShell fails before Node starts, and the PR includes the resulting Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the narrow cross-shell documentation update after the normal exact-head merge gate, keeping the README as the single command reference and leaving runtime/provider behavior unchanged. Do we have a high-confidence way to reproduce the issue? Yes. Running the current POSIX-style inline environment assignment in native PowerShell fails before Node starts, and the PR includes the resulting Is this the best way to solve the issue? Yes. Separating POSIX and PowerShell commands in the example README is the narrowest maintainable fix, while replacing the duplicate script-header commands with a README pointer prevents shell-specific instructions from drifting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f2828b50ada. Label changesLabel justifications:
Evidence reviewedPR surface: Docs +17, Other -2. Total +15 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (1 earlier review cycle)
|
e1618d5 to
36f9a94
Compare
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
36f9a94 to
38ddcb7
Compare
|
Maintainer review complete. This is the best fix: the example README owns shell-specific invocations, while I rebased the branch and refined cleanup to PowerShell's official Proof on exact head
Known gap: this Mac has no local |
|
Merged via squash.
|
…enclaw#108567) * docs(ai): add PowerShell instructions to the minimal chat example Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> * docs(ai): simplify PowerShell key cleanup --------- Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
What Problem This Solves
Resolves a documentation gap where developers following the minimal
@openclaw/aiexample from native PowerShell could not directly use the documented environment-variable commands.The existing
KEY=value commandsyntax is valid in POSIX shells, but PowerShell treatsANTHROPIC_API_KEY=...as an executable name and exits before Node starts.Why This Change Was Made
The example now provides separate POSIX and PowerShell commands, uses the repository's secret-scanner-safe placeholders, states how long PowerShell assignments remain in scope, and shows how to clear both session-scoped keys with
$env:KEY = $null. The script header points to the README as the canonical command reference so the shell-specific instructions do not drift.Runtime behavior, provider selection, and the keyless Ollama command are unchanged.
User Impact
Developers can run the example from either a POSIX shell or native PowerShell without translating environment-variable syntax. PowerShell users are also shown how to remove the session-scoped API keys without waiting for the shell to close.
Evidence
User-realistic path:
Before, the POSIX form fails before Node starts:
After, a no-network Node probe receives both the PowerShell environment variable and the quoted prompt:
{"key":"example-anthropic-key-not-real","argv":["Say hello"]}The cleanup now uses Microsoft's documented PowerShell 5.1 environment-variable contract:
$env:KEY = $nullremoves that variable from the current process session, while child processes inherit assigned environment variables. See about_Environment_Variables.Validation:
node --check examples/ai-chat/index.mjs- passedgit diff --check- passednode scripts/check-changed.mjs -- examples/ai-chat/README.md examples/ai-chat/index.mjs- passed all fail-safe lanes on Blacksmith Testbox (run 29494981621, exit 0)