Skip to content

Dashboard actions: sessions, handover and config edits left from #36 round 2 #37

Backlog

Description

@catalan-adobe

Left from round 2 of #36 (dashboard D2b: the PR actions and gh pr-review delta), whose rule was: after round 2, fix only critical findings, then merge. The critical finding, an inherited git -c textconv driver writing a broken ref into the clone, was fixed in #36 (49a3a52). The review's full text is in round 2 on #36.

These remain:

Important

  • F3 · dash/src/actions_app.rs:333 — The editor’s file is verified before the session locks the worktree. Static symlinks out of the checkout are now refused. But e resolves an absolute path from cached status and passes it to a session that independently re-reads pr.json. If a preview used another --clone since the last refresh, the old worktree can still exist: the session locks the new clone while the editor opens the old file. A preview finishing between verification and lock acquisition can also replace a previously regular path with a symlink.

    • Pass the relative finding path into the session. Resolve it and check containment against the locked worktree immediately before launching the editor. Test with cached status naming one worktree and pr.json naming another.
  • F7 · dash/src/actions.rs:100 — A shell case pattern still breaks placeholder quoting inside command substitution. The reported $(cat {brief}) case is fixed. In agent "$(case md in md) cat {brief};; esac)", however, the lexer mistakes the pattern’s ) for the end of $(). It emits ${GH_PR_REVIEW_BRIEF} unquoted inside cat. I checked the resulting expansion with dash: a value of two words becomes two arguments.

    • Either parse this context correctly or reject it explicitly and direct users to a wrapper script. Keep the environment-variable transport; the remaining bug is where the reference is quoted.
  • F8 · dash/src/actions.rs:15 — The default agent can still load PR-authored system instructions. --no-context-files fixes the AGENTS.md and CLAUDE.md case. Pi 1.7.0 discovers .pi/SYSTEM.md and .pi/APPEND_SYSTEM.md separately (dist/core/resource-loader.js:492,961–975). If the user already trusts the worktree or its parent, a later PR revision can supply either file without a new trust decision. The brief is then not the only source of project instructions, contrary to dash/README.md:237–242.

    • Add --no-approve to the built-in command to force untrusted-project mode. Leave trusting the checkout as an explicit custom-command choice, and test the already-trusted-parent case.
  • dash/src/config.rs:143 — Rejecting an agent template can launch a different agent instead. A config containing claude 'Read {brief}' fails the new validation, but load at line 159 replaces the whole dashboard config with defaults. After the startup warning expires, pressing a runs Pi rather than refusing the action; unrelated settings such as max_jobs and model are lost too. The refusal test sets the command directly on an already-loaded app, so it misses the production path.

    • Preserve the other settings and retain the agent validation error so a shows it and launches nothing. Test through config::load.
  • dash/src/handover.rs:134 — The parent can take foreground ownership away from the child’s own job. The pre-exec hook already gives the terminal to the child before it runs. The parent gives it to that same group again after spawn() returns. If the parent is descheduled and the child meanwhile foregrounds a different process group, the second call undoes that transfer. The foreground job can then stop on its next terminal read while the dashboard waits for the launcher.

    • Perform the initial transfer once, in the pre-exec hook, and propagate tcsetpgrp failure rather than returning Ok(()) unconditionally. Keep the parent’s transfers for reclaim and explicit resume.
  • dash/src/main.rs:267 — Quitting can silently discard a confirmed mute or unmute. Confirmation now queues an effect. If confirmation and q are in the same input batch, the loop breaks before dispatching it. If the worker has started but is waiting on the config lock, shutdown does not wait for it either. The dashboard can exit successfully with the config unchanged.

    • Track outstanding config writes. On quit, dispatch and finish confirmed writes, or tell the user the edit is pending and let them choose whether to abandon it. Cover both a same-batch quit and a held config lock.

Minor

  • dash/src/cli.rs:412 — A cancelled delta can leave its spool file behind on quit. Cleanup depends on the event loop receiving the result or finishing the handover. Cancel followed by quit can drop the receiver or its queued message, leaving a private but potentially large diff on disk. Pass an already-unlinked file descriptor to the pager, or give the spool an owner that handles shutdown as well as ordinary completion.
  • dash/tests/pty.rs:269 — Later redraw checks can match the first shell’s output. wait_for searches the entire transcript, and the exit-code-4 message was already present at line 246. The waits at lines 269 and 279 therefore do not establish that those handovers have returned before the next key is sent. Record the transcript offset before each handover and match only newly written output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions