Skip to content

docs(opencli): add env preflight for browser token#4

Open
ssdiwu wants to merge 4 commits intojoeseesun:mainfrom
ssdiwu:docs/env-token-preflight
Open

docs(opencli): add env preflight for browser token#4
ssdiwu wants to merge 4 commits intojoeseesun:mainfrom
ssdiwu:docs/env-token-preflight

Conversation

@ssdiwu
Copy link
Copy Markdown

@ssdiwu ssdiwu commented Mar 17, 2026

Summary

This PR adds a small but important troubleshooting and preflight flow for browser-backed opencli usage in agent runtimes.

It teaches the skill to:

  • check PLAYWRIGHT_MCP_EXTENSION_TOKEN before repeatedly retrying browser authorization
  • stop the retry loop when the token is missing from the current process env
  • ask the user to provide the token or confirm persistence
  • branch remediation by runtime:
    • OpenClaw / gateway service: prefer ~/.openclaw/.env + openclaw gateway restart
    • Claude Code / direct terminal: persist in the shell env used to launch the agent
  • verify the fix by re-checking env presence and running a small opencli ... -f json command

Why

A common failure mode is:

  • opencli works in a normal terminal
  • the same task inside an agent runtime keeps asking for browser authorization again

In OpenClaw specifically, this often happens because the gateway runs as a background service and does not automatically inherit the current shell environment.

Changes

  • add Environment Preflight to SKILL.md
  • add OpenClaw-specific remediation guidance
  • add bilingual troubleshooting notes to README.md

Scope

This PR is intentionally documentation and skill-behavior only.
It does not auto-write secrets without user confirmation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant