Add verbose CLI progress events#2673
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66136ee73c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const startedAt = Date.now(); | ||
| emitCliVerboseEvent({ | ||
| event: 'command_start', | ||
| args: compactCliVerboseArgs(handlerArgs), |
There was a problem hiding this comment.
Redact sensitive CLI args from verbose events
When --verbose is used, the command_start event serializes all handlerArgs directly; for the computer RDP tools the accepted init args include password (packages/computer/src/mcp-tools.ts), so a command such as midscene-computer --verbose act --host ... --username ... --password ... prints the password in the structured JSON progress stream. Because these verbose logs are intended for progress collection and may be persisted by CI or wrappers, sensitive keys such as password/token/apiKey should be redacted before emitting the args payload.
Useful? React with 👍 / 👎.
Deploying midscene with
|
| Latest commit: |
7ece567
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://06d3ebb4.midscene.pages.dev |
| Branch Preview URL: | https://feat-shared-cli-verbose-prog.midscene.pages.dev |
Summary
--verboseCLI flag that prints readable progress while Midscene commands are running.aiActverbose output a clean human-readable timeline: start prompt, each plan's latest screenshot, planned reasoning, action details, action running/done status, timing, and final completion text.aiActscreenshot paths next to the report undermidscene_run/report/screenshots/, so agents and humans can open the exact screenshot referenced by each plan step.actcommands and keep--verbose=jsonlas the structured machine-readable event stream..png.Example
Real stdout from
./packages/web-integration/bin/midscene-web --verbose act --prompt "click the blue Search button"againstpackages/web-integration/tests/ai/fixtures/input-test.html:Validation
pnpm exec biome check packages/shared/src/cli/verbose.ts packages/shared/src/cli/screenshot-file.ts packages/shared/src/mcp/tool-generator.ts packages/core/src/types.ts packages/core/src/agent/tasks.ts packages/shared/tests/unit-test/tool-generator.test.tspnpm --dir packages/shared exec vitest run tests/unit-test/tool-generator.test.ts -t "verbose"pnpm exec nx test @midscene/sharedpnpm exec nx build @midscene/webmidscene-webrun against local fixture:./packages/web-integration/bin/midscene-web --verbose act --prompt "click the blue Search button"; verified stdout includesStart, per-plan screenshot paths,Planned,Action,Running,Done, andCompletelines.pnpm run lintwas run, but it fails locally on unrelated untracked filespackages/web-integration/swipe-verify.cjsandpackages/web-integration/swipe-verify2.cjswithlint/style/useSingleVarDeclarator; those files are not part of this PR.