system_interface: drive layout ops against the pre-merge preview#194
Open
gnguralnick wants to merge 3 commits into
Open
system_interface: drive layout ops against the pre-merge preview#194gnguralnick wants to merge 3 commits into
gnguralnick wants to merge 3 commits into
Conversation
added 3 commits
June 22, 2026 12:03
Add a SYSTEM_INTERFACE_LAYOUT_DIR override so the preview instance persists its own dockview layout to a throwaway dir under its state rather than clobbering the live layout.json, and a preview_layout.py wrapper that runs scripts/layout.py against the preview's inner port. This lets the previewing agent navigate the preview to the scenario being changed (inspect/open/focus/split/maximize) instead of the user clicking around. The skill also now tears the preview down before the worker reworks on a rejection/change request, so it never serves stale, in-flux, or half-built assets.
Problem: reveal_system_interface.py's comment on the preview layout-dir override claimed ''inspect'' / wait-stable / ''self'' all work with ''full fidelity'', but the ''self'' ref is resolved server-side from the lead's MNGR_AGENT_ID to that agent's own chat panel, which is not guaranteed open in the preview's dockview. The wrapper docstring and SKILL.md already caveat this, so the comment was misleading and self-contradictory. Fix: reword the comment to claim fidelity only for what actually works (inspect/list, wait-stable, no-op detection, surviving reload) and note that ''self'' depends on the lead's chat tab being open, pointing to explicit chat:<name> refs -- consistent with the wrapper docstring and SKILL.md.
scripts/layout.py already targets whatever MINDS_WORKSPACE_SERVER_URL points at, so the preview_layout.py wrapper was ~290 lines (incl. tests) doing little more than resolving inner_port and prefixing that env var. Remove it. Instead, the preview command now prints a copy-pasteable MINDS_WORKSPACE_SERVER_URL=http://127.0.0.1:<inner_port> layout.py invocation, and the skill documents pointing layout.py at the inner port directly. The SYSTEM_INTERFACE_LAYOUT_DIR backend override -- the one genuinely necessary change, which lets the preview inspect/persist its own layout -- stays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the previewing agent drive
manage-layoutops against the pre-merge preview in theupdate-system-interfaceflow, so it can navigate the preview straight to the scenario being reviewed instead of leaving the user to click around the preview app.What changed
SYSTEM_INTERFACE_LAYOUT_DIRoverride (apps/system_interface/.../server.py):_primary_agent_layout_dir()now honors this env var, taking precedence over theMNGR_AGENT_ID-derived path. This decouples where layout is persisted from agent identity.reveal_system_interface.py): thepreviewcommand pointsSYSTEM_INTERFACE_LAYOUT_DIRat a dir under the preview's own state instead of neutering persistence. The preview therefore supports a fullinspect/list(and wait-stable confirmation + no-op detection), while still never touching the livelayout.json.unpreviewcleans it up with the rest of the state dir.preview_layout.pywrapper (new, stdlib-only): readsinner_portfrom the preview state file and runsscripts/layout.pyagainst the preview instance viaMINDS_WORKSPACE_SERVER_URL. Everymanage-layoutverb works verbatim but lands on the dockview inside the preview frame, not the live UI.SKILL.md): a "drive the preview to the scenario" step (distinguishing it fromlayout.py open si-preview, which arranges the live tab hosting the preview), plus an instruction to tear the preview down before the worker reworks on a rejection/change request, so it never serves stale, in-flux, or half-built assets.Because the preview drops
MNGR_AGENT_ID, theselfref resolves only when the lead's chat tab is open in the preview; the docs recommend explicitchat:<name>refs (discoverable vialist) for anchoring.Tests
apps/system_interface: override precedence + save/get round-trip through the override dir (server_test.py).previewenv var is asserted (reveal_system_interface_test.py); newpreview_layout_test.pycovers state loading, port validation, and the layout invocation (via an injected runner).apps/system_interfaceunit+integration suite passes (3 pre-existing failures are environmental — two Playwright browser e2e tests and one subprocess-spawn test — and fail identically onmain).