2.8 KiB
2.8 KiB
Task: Remediate X-01 preview CDP enable
Identity
- Task ID: 20260827-x01-cdp-enable-4e8a2c71
- Mode: Feature
- Branch: codex/20260827-x01-cdp-enable-4e8a2c71-x01-cdp-enable-4e8a2c71
- Worktree: D:\Datas\OthersProjects\makelore-x01-cdp-enable-4e8a2c71
- Base commit:
afb5c10fae - Owner: codex
- Status: Ready for Integration
Scope
- Update
electron/agent-browser/module.tsso preview-data CDP setup enables the same root or child session immediately beforePage.addScriptToEvaluateOnNewDocument. - Add focused root/child ordering and
sessionRefregression coverage intests/unit/agent-browser-core.test.ts. - Maintain this task record only; no coordinator worktree, PR, live run, or broader CDP refactor.
Intent And Constraints
- Exact remediation for X-01 packaged evidence:
Page.enablemust precede every preview-data script installation while preserving the optionalsessionRef. - Preserve the existing target URL origin fix and exact-origin getter from the base commit; ownership is limited to the two source/test files and this record.
- The prior injection-origin task was released before this task started; the coordinator remains at the recorded exact base and is not modified.
Planning Gate
- Result: Passed.
- Evidence: prior task released; isolated task/worktree started from
afb5c10fae090567869fcd7a10410a8be2c963ad; repository project-docs startup instructions and architecture/coordinator scope records were read; no conflicting ownership was found.
Plan
- Add
Page.enablewith the same optional session reference immediately before each preview script command. - Assert root ordering and child ordering/session propagation in focused tests.
- Run focused tests, typecheck, scoped lint, documentation drift, then commit once and leave the worktree clean.
Outcome
- Added
Page.enableimmediately before every preview-dataPage.addScriptToEvaluateOnNewDocumentcall, passing the same optionalsessionReffor root and document-child sessions. Added root and child ordering/session propagation assertions while preserving the existing target URL and exact-origin injection behavior.
Verification
- PASS:
corepack pnpm vitest run tests/unit/agent-browser-core.test.ts(77/77). - PASS:
corepack pnpm run typecheck. - PASS:
corepack pnpm exec eslint electron/agent-browser/module.ts tests/unit/agent-browser-core.test.ts. - PASS:
git diff --check. - PASS: project-docs drift/completion gates (recorded before commit).
- The isolated worktree required
corepack pnpm install --frozen-lockfile --offlinebefore the focused command; no tracked dependency files changed.
Follow-ups
- None. No live/E2E run was requested for this bounded remediation.
Promotion Candidates
- Commit the single source/test/documentation change after the documentation gate passes.