Repository navigation
[Review 136] [6/7] feat: reuse workspace context and navigate agent output - #6
BIackFIame wants to merge 46 commits into
Conversation
Adds the Files canvas card: a read-only browser and reader rooted either at a live terminal session working directory or at a folder picked in a native dialog. Main owns access through a new FileAccessService that canonicalizes root and target with realpath, rejects absolute paths, `..`, escaping symlinks and non-regular files, and enforces byte, entry, depth and result caps; the renderer only receives an opaque root id plus relative paths over the allow-listed `files:*` channels. Cards persist and restore their root, bounds, open file and expanded folders, and show an unavailable state when a root is gone. Text and code are rendered richly: Markdown files render as GitHub-Flavored Markdown (headings, lists, task lists, tables, blockquotes, rules, inline and fenced code) and recognized code files are syntax-highlighted by extension. Rendering is sanitized (no raw HTML, event handlers or dangerous schemes; no innerHTML), http(s) links open in the built-in browser, only embedded `data:` images render, and files above the ~250 KB threshold fall back to plain text with a notice. The heavy Markdown/highlight renderers and the card are lazy-loaded to keep them out of the startup bundle. Excluded: the unrelated custom-agents WIP is intentionally not part of this branch. Also raises the renderer static-graph budget in tests/renderer-bundle-splitting.test.mjs (still well under the old ~1.6 MB single chunk) to account for the new card's startup orchestration.
`FileAccessService` registered roots with `realpathSync` but canonicalized targets with the async `realpath`, which on Windows can return a differently cased or 8.3-shortened path. The prefix containment check then treated the root itself (and every child) as outside the root, so listing/reading failed. Resolve targets with the same `realpathSync` used at registration and compare normalized (case-insensitive, `\\?\`-stripped) paths on Windows. Windows CI: tests/file-access-service.test.mjs and files-ipc-security.test.mjs were the 13 failing tests; they now pass on Linux and should on Windows.
|
@codex review Please review this PR's diff for correctness, regressions and security issues. Review only; post findings on GitHub without changing code. This is the contributor-fork review for howdeploy#136, at the identical head commit |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2c0b767ae
ℹ️ 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".
|
@codex review Additional verification round 1 of 5: workspace import and preset correctness. Review current head 0df5f9c. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on workspace import and preset correctness. Report actionable defects; please do not apply changes. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0df5f9ce7f
ℹ️ 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".
|
@codex review Additional verification round 2 of 5: asynchronous UI races and partial delivery. Review current head 6ced4b0. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on asynchronous UI races and partial delivery. Report actionable defects; please do not apply changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ced4b08cc
ℹ️ 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".
|
@codex review Additional verification round 3 of 5: plugin consent and data boundaries. Review current head 957a11e. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on plugin consent and data boundaries. Report actionable defects; please do not apply changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 957a11eb41
ℹ️ 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".
|
@codex review Additional verification round 4 of 5: compatibility and error handling. Review current head da8a0ca. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on compatibility and error handling. Report actionable defects; please do not apply changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da8a0cae98
ℹ️ 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".
|
@codex review Additional verification round 5 of 5: final integrated regressions. Review current head 9ffb641. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on final integrated regressions. Report actionable defects; please do not apply changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ffb641b65
ℹ️ 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".
|
@codex review Bounded extra verification round 1 of at most 2 after the five planned rounds: bounded verification of fixes from the fifth review. Review current head 3633848. Reviewed parent fixes have been merged, and previous findings have been addressed. Review the integrated workspace changes, focusing on bounded verification of fixes from the fifth review. Report actionable defects; please do not apply changes. |
# Conflicts: # src/main/ipc/registerIpc.ts # src/renderer/src/App.tsx # tests/app-shortcuts.test.mjs
# Conflicts: # package-lock.json
This integrates the six contributions accepted during the maintainer's DEV review, together with the maintainer's local UI and minimap fixes. Rejected orchestration features, including howdeploy#133, are excluded entirely. ## Included contributions and credit - howdeploy#125 by @tab11pm: read-only file cards, directory browsing, and richer Markdown/code previews. - howdeploy#130 by @SaneSanders: image/material remarks and handoff to an existing agent session. - howdeploy#131 by @BIackFIame: macOS clipboard/edit context menus for text fields. - howdeploy#138 by @pepechka-kun: usage history, measured quota changes, local-log evidence, and explicit attribution uncertainty. - howdeploy#139 by @CLOSETTTY: interactive mascots and the Codex mascot creation workflow. - howdeploy#140 by @teo-nex: the macOS node-pty file-descriptor leak fix, patch delivery, and resource diagnostics. Thank you to all six contributors. Each original PR head and its author commits are retained in Git history through separate merge commits. This integration must use a merge commit rather than squash or rebase. ## Maintainer patches - Fit the minimap overview to the camera viewport and all canvas objects together, with padding; retain stable drag coordinates during a gesture. - Keep the material handoff icon fixed in the header, remove the count beneath it, and place equally sized Cancel/Send actions at the bottom right of the handoff dialog. - Split usage history into five left-side sections: conditional estimate, quotas, agents, local-log tokens, and source state. Use pages within sections to fit the window without a long scrolling report. - Resolve shared App/IPC/preload integrations while retaining the file, handoff, and usage-history flows. - Retain the approved DEV dependency set and Electron 43.7.7; reuse the matching lockfile with patch-package 8.0.1. ## Scope howdeploy#132, howdeploy#133, howdeploy#134, howdeploy#135, and howdeploy#137 are not included. howdeploy#136 is also excluded pending the previously requested UI/UX redesign. No commits from that cumulative orchestration series are ancestors of this branch. Material handoff in howdeploy#130 does not automatically apply a saved JSON agent report to the material state; this remains the reviewed behavior. ## Validation - `VITE_BUILD_CHANNEL=DEV npm run build` passed, including the script's TypeScript checks and native-helper build. - `git diff --check` passed. - Verified that all six accepted PR heads are ancestors of the integration and all six excluded PR heads are not. - Verified that the three approved local UI/minimap implementations match the selected DEV copy. - Added minimap geometry coverage for distant camera positions and adapted usage-history fixtures for section navigation. - The maintainer manually reviewed the accepted features in the earlier combined DEV build. The final integration without howdeploy#133 has not received another manual UI pass. Automated tests and macOS/Windows runtime checks were not run locally for this integration.
The approved DEV lockfile carried into howdeploy#141 was generated with npm 12. GitHub CI uses Node 22/npm 10, whose `npm ci` rejected the incomplete transitive dependency graph before any application tests ran. Regenerate the lockfile using the already installed Node 22.22.0/npm 10.9.4. This adds the missing dependency entries required by app-builder-lib's @electron/get 3.x tree. No package.json changes or changes to existing package versions, artifact URLs, or integrity hashes are included. Validation: `npm ci --dry-run --ignore-scripts --no-audit --no-fund` passed with npm 10.9.4; `git diff --check` passed. No dependencies were installed and no lifecycle scripts were executed for this repair. The DEV application build passed before this lockfile-only change. Application tests and platform UI checks were not run locally. This is a maintainer integration fix; the original contributor commits and acknowledgments in howdeploy#141 remain unchanged.
Prepare CanvasTTY 1.8.0 from the approved main integration, preserving all contributor history and the maintainer's UI/minimap patches. - Bump package and lockfile versions together and document the user-visible changes in all three changelogs. - Fix the release-blocking Hermes read path: use an immutable read before opening a stopped WAL database without side files, so collection does not create a WAL file in the source directory. The existing live/stopped/orphaned WAL regression covers this behavior. - Refuse symlinked or replaced usage-history paths before reading on Windows as well as Unix; retain the existing symlink regression. - Adapt Windows Codex fixture launches to the existing batch-launch path, restrict chmod-specific assertions to platforms that implement Unix permissions, and update the history overlay assertion for the merged material dialog guard. Cross-platform accounting and symlink checks remain enabled. Validation: `git diff --check`, matching manifest/lockfile versions, and a clean local Linux AppImage/DEB build passed. The Linux update manifest matches both artifacts' sizes and SHA-512 hashes. CI tests passed on Linux and Windows; Windows and macOS package checks, both mascot-pipeline jobs, and the macOS PTY job passed. A subsequent Linux packaging step failed with HTTP 504 after the application build; that single job is being rerun. The tagged release workflow repeats the required release checks, builds native installers for all three platforms, and verifies the complete signed update artifact set before publishing. No local UI check or real-device update test has been run. Release notes credit @tab11pm, @SaneSanders, @BIackFIame, @pepechka-kun, @CLOSETTTY, @teo-nex, @Yt4aZaveta, and @theorangecolorv2. The orchestration additions in howdeploy#132–137 remain excluded.
The 1.8.0 release build caught a macOS Files reader bug before publication: the descriptor-path check accepted `/dev/fd/<n>` as if it were a resolved filesystem target and rejected every regular file as outside the registered root. Ignore descriptor-device paths that do not resolve to a file path, and compare the opened file's device/inode with the current canonical path before reading. Root containment, O_NOFOLLOW, regular-file checks, and Linux descriptor-path checks remain in place. A missing path returns the existing unavailable state. Add a regression simulating descriptor devices on every test platform. Bump to 1.8.1 and update all changelogs. The failed 1.8.0 tag remains unchanged and no 1.8.0 release was published. The accepted contributor history and maintainer patches remain intact. Validation: the 1.8.0 release tests passed on Linux; its preflight tests and packaging passed on Windows and macOS. The full release macOS unit suite exposed this bug. A new tagged build will repeat native packaging and all required checks on all three operating systems before publication. No local UI check has been run.
…e startup bundle The canvas command palette and the canvas context menu are rendered only while they are open, but both were static imports of the canvas and so part of the startup bundle. They are now separate chunks, which frees about 18 KB of the startup bundle, and still open at once: the canvas preloads both chunks once it is idle after its first paint, and renders the loaded component directly. There is no lazy() and no Suspense boundary on this path (React holds a suspended boundary's reveal for up to 300 ms, which would delay the first right-click and the first Cmd/Ctrl+K). An open before the preload has finished loads the chunk at once and shows the menu as soon as it arrives. renderer-bundle-splitting checks that each is its own chunk, reachable only through a dynamic import(); canvas-preloaded-surfaces renders both with the real React through the real imports and checks that a preloaded menu and palette are in the very first render of an open.
Right-clicking empty canvas now shows a Tools row with one Auto-sort action. The criteria (by task, by status, by project, grid) are radio rows in that submenu, built with the existing canvas menu primitives. There is no separate panel, toolbar, presets or layouts list. - Scope: the current multi-selection when it holds two windows, otherwise terminal, plugin and Browser windows that are not completely inside a region. Companion mascots move only when selected. Sticky notes, materials and Files cards never move. - "By task" uses the orchestrator-to-subagent relation that already exists (parentSessionId): each subagent goes to the right of its parent. - The layout is deterministic: ties follow the current reading order, and sorting twice changes nothing. The block keeps the windows' top-left corner and keeps clear of HOME, regions, notes, materials, Files cards and windows it does not move (it shifts right or down, whichever is shorter, and never lands inside a region). With snapping on, every window lands on the 10px grid with the 20px snapping gap. - Moved windows get a presentation-only outline that clears on the next press or after a few seconds (they are not made the marquee selection), and a short glide that is skipped when reduced motion is requested. The Browser card does not glide, because its native view is placed from the measured card. - "Undo auto-sort" stays in the submenu while a sorted window is still where the sort put it. It restores only those windows. There is no global undo shortcut, so terminals and text inputs keep their keys. - The last criterion is kept in renderer memory for the running session, only after a sort happened. Nothing is persisted. A failed load or sort shows a localized toast. - The group-drag commit is extracted into commitLayerBounds and shared with auto-sort. - The Tools submenu body, scope and layout are not in the startup bundle: they load while the empty-canvas menu is open (or when Tools is pressed first), so the submenu still opens at once. Adds the official Lucide wrench and undo-2 icons, ru/en strings, and the UI contract text in en/ru/zh-CN. Tests drive the menu and the submenu.
…ed out - A context menu opened near a corner panel (minimap, shortcut hints, Home/zoom controls) moves up until it clears it; it was drawn over the bottom of the Home/zoom bar. When moving up cannot clear every panel (a tall menu near the right edge at UI scale 1.25, between the minimap and the shortcut hints), it moves sideways beside the panel it hits, at its own height; with no room on either side it keeps its place. Menus stay above the corner panels. - A submenu (Tools, Launch agent) opens where it covers no corner panel either: when its usual side and direction would run over the shortcut hints, minimap or Home/zoom controls (in whichever corners Settings put them), it opens in the other direction or on the other side; at UI scale 1.25 near the right edge, Tools opened over the hints panel and left its clipped text showing beside it. - The chevrons of Launch agent and Tools point to the side their submenu opens (the vendored chevron, rotated), not down. - "Needs at least 2 windows" is a plain hint, not the uppercase group label. It lines up with the radio labels and is as muted as the disabled rows it explains, so it does not read like an active item. - Zoomed out (summary), the outline of the windows a sort moved grows with the summary scale, so it stays visible at overview zoom for its 4 s. The placement code (and the existing chooseCanvasSubmenuSide) moves from canvasContextRouting to canvasMenuPlacement, which only the lazily loaded menu imports, so it stays out of the startup bundle.
3b151b2 to
9bd9079
Compare
Review purpose
Review-only copy of the prepared CanvasTTY series in the contributor's fork. This step covers: [6/7] feat: reuse workspace context and navigate agent output.
Related: howdeploy#136
The head is the exact upstream PR commit
e2c0b767ae2c5c91e20e13daa5f2a654aaf6029e. The base isbacklog/4-protectionat9eb11095d6900c999a09b7d8e2da8ace953643e8. The upstream PR is cumulative against upstream main; this review compares only this step against its predecessor, with inherited code available as context.This PR is for review, not merging. Keep feedback attached to this exact commit. Source validation, live-test limitations and series context are recorded in the upstream PR; no new tests were run when creating this review copy.