feat: project run skill for dev and isolated lab launches#33
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f533c59245
ℹ️ 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".
| dbus-run-session -- env -u WAYLAND_DISPLAY GDK_BACKEND=x11 DISPLAY=":$DISPLAY_NUM" \ | ||
| bun run tauri dev --config "{\"identifier\":\"com.pickforge.pickgauge.labtest\",\"build\":{\"devUrl\":\"http://127.0.0.1:$PORT\",\"beforeDevCommand\":\"\"}}" |
There was a problem hiding this comment.
Isolate the lab launch from real provider credentials
When this lab command is used on a developer machine with existing Codex/Claude/Grok credentials, it only changes Tauri's identifier and leaves HOME/XDG config pointing at the real profile. The app still loads the hard-coded real config path (src-tauri/src/config.rs:8) and refreshes on startup (src-tauri/src/lib.rs:2326); with the default CLI providers enabled, that reads $HOME/.codex/auth.json, $HOME/.claude/.credentials.json, and $HOME/.grok/auth.json and makes real usage requests (src-tauri/src/cli_provider.rs:158, :263, :365). As a result, a supposedly isolated screenshot/lab run can touch real provider credentials and network APIs before any UI action, so the launch should sandbox HOME/XDG_CONFIG_HOME or otherwise disable providers for lab runs.
Useful? React with 👍 / 👎.
| DISPLAY_NUM=93 | ||
| PORT=1431 # replace with an unused port |
There was a problem hiding this comment.
Require a free X display for lab sessions
For concurrent or leftover lab sessions, this hard-coded DISPLAY_NUM=93 can collide even when the agent correctly chooses a free Vite port: Xvfb will fail if :93 is already in use, while the later xdotool/import/cleanup steps still target :93 and can interact with another lab's display. Since the skill is meant to make verification reliable across agent runs, it should tell agents to choose an unused display number just like it does for the port.
Useful? React with 👍 / 👎.
| dbus-run-session -- env -u WAYLAND_DISPLAY GDK_BACKEND=x11 DISPLAY=":$DISPLAY_NUM" \ | ||
| bun run tauri dev --config "{\"identifier\":\"com.pickforge.pickgauge.labtest\",\"build\":{\"devUrl\":\"http://127.0.0.1:$PORT\",\"beforeDevCommand\":\"\"}}" |
There was a problem hiding this comment.
Prevent lab startup from rewriting autostart
When the real PickGauge config has autostart.enabled set, this lab launch still loads that config and runs startup autostart sync before any UI interaction (src-tauri/src/lib.rs:2310, sync_autostart at :387). The autostart plugin registers the current executable, so a debug/lab tauri dev run can persist the dev binary as the PickGauge login item even though the skill only warns not to touch autostart in Settings; disable/sandbox autostart for lab runs instead of relying on avoiding that UI.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ 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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20c2cbe1eb
ℹ️ 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".
| : "${PORT:?No free port in 1421-1499}" | ||
| unset DISPLAY_NUM; for n in $(seq 90 120); do [ ! -e "/tmp/.X11-unix/X$n" ] && DISPLAY_NUM=$n && break; done | ||
| : "${DISPLAY_NUM:?No free X display in 90-120}" | ||
| printf 'export PORT=%s\nexport DISPLAY_NUM=%s\nexport LAB_HOME=%s\nexport REAL_CARGO_HOME=%s\nexport REAL_RUSTUP_HOME=%s\n' "$PORT" "$DISPLAY_NUM" "$LAB_HOME" "$REAL_CARGO_HOME" "$REAL_RUSTUP_HOME" > /tmp/pickgauge-lab.env |
There was a problem hiding this comment.
Make the lab state file unique per run
When two agents follow the isolated lab flow concurrently, this fixed /tmp/pickgauge-lab.env path lets the later setup overwrite the first lab's PORT, DISPLAY_NUM, and LAB_HOME. The first agent's later verify/cleanup snippets then source the second lab's state, so screenshots can target the wrong display and cleanup can kill or leave the wrong lab despite the identifier suffix being intended to isolate concurrent labs. Use a per-run env file and carry that path through the snippets.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9154f566f0
ℹ️ 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".
| source "$PWD/.lab.env" | ||
| Xvfb ":$DISPLAY_NUM" -screen 0 1440x1000x24 -nolisten tcp & | ||
| for _ in {1..50}; do [ -e "/tmp/.X11-unix/X$DISPLAY_NUM" ] && break; sleep 0.1; done | ||
| [ -e "/tmp/.X11-unix/X$DISPLAY_NUM" ] || { echo "Xvfb did not start" >&2; false; } |
There was a problem hiding this comment.
Stop the lab launch when Xvfb fails
When this launch block is pasted into a normal shell as instructed, it has no set -e, so in environments where Xvfb is missing or cannot create /tmp/.X11-unix/X$DISPLAY_NUM, this false only fails that single command and the snippet continues to start xfwm4, Vite, and Tauri against a dead display. That leaves background processes running and obscures the real setup failure; make this branch exit/return or add fail-fast handling to the launch block.
Useful? React with 👍 / 👎.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ 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". |
Encodes the launch quirks agents kept relearning: Wayland leak (GDK_BACKEND=x11 + unset WAYLAND_DISPLAY), labtest single-instance identifier, Xvfb+xfwm4, tray-first capsule click, real-user-data warning (config path stays keyed on the real identifier), pid-based cleanup. Canonical in .agents/skills/run with a .claude/skills symlink. Refs #31
Lab launches now override HOME + XDG dirs to a fresh temp profile (CARGO_HOME/RUSTUP_HOME kept real), so a lab boot cannot read real CLI provider credentials or register the dev binary as a login item; verified via /proc/<pid>/environ, blank provider state, no autostart entry, and unchanged real-config mtime. X display scanned instead of hard-coded; cleanup patterns parameterized; capsule click made reliable with --sync mousedown/mouseup.
Applies the union of sibling-review findings for consistency: lab state persists via /tmp/pickgauge-lab.env, bun install in the lab path, ss guarded, Xvfb waited on, app kill gated on lab environ, lab identifier suffixed with display number so concurrent labs cannot single-instance-ping each other. Verified end-to-end: capsule click opened the main window, 'No services enabled' with empty profile, no autostart entry, clean teardown.
Lab state moves from a shared /tmp path to $PWD/.lab.env (gitignored) so concurrent labs in separate worktrees cannot clobber each other's state.
Launch block gets set -e so a failed Xvfb stops the recipe; prepare refuses to overwrite live lab state; cleanup refuses to run without .lab.env and fails on unset vars.
bcf88b7 to
85041af
Compare
Adds a project
runskill so any agent can launch PickGauge — normal dev or an isolated headless lab instance — without rediscovering the launch quirks: Wayland leak isolation (env -u WAYLAND_DISPLAY GDK_BACKEND=x11),.labtestsingle-instance identifier override with a separate Vite on a free port, private D-Bus session for tray registration, Xvfb + xfwm4, capsule-click to open the tray-first main window, pid-based cleanup (nopkill -fin compound commands).Canonical skill at
.agents/skills/run/SKILL.md(agent-neutral), with.claude/skills/runas a relative symlink for Claude Code discovery.Tested (by the builder, full transcript kept):
bun install --frozen-lockfile; Vite served 200 on a free port and was stopped by pid; sidecar freshness check; full lab boot on Xvfb:93with the labtest identifier (native debug binary launched); ImageMagick root-window capture; all lab processes verified stopped. Skill discovery from this repo validated with a headless session.Known limitation (documented in the skill): the config path stays keyed on the real identifier, so a lab instance sees real user data — the skill forbids destructive UI actions.
Not release-note-worthy: agent tooling only, no app changes (
docs/releases/UNRELEASED.mduntouched).Closes #31
Part of the agent-DX batch: pickforge/pickforge-platform#19