gstack icon indicating copy to clipboard operation
gstack copied to clipboard

/autoplan paper cuts: literal <plan_path> placeholders + /office-hours offer fires in non-interactive sessions

Open aviraldua93 opened this issue 5 months ago • 1 comments

Filed downstream at aviraldua93/gstack-copilot#10. Two paper cuts in upstream gstack /autoplan found by reading the SKILL.md.tmpl end-to-end.

1. <plan_path> literal placeholder is unsafe

Codex prompt templates use <plan_path> as a literal placeholder string and instruct the agent to substitute at runtime. Careless implementation passes <plan_path> literally to Codex / the subagent. No validation step catches it. Agent returns nonsensical "cannot find the file" output that looks like a review failure.

Fix: use shell-substitution-style placeholders that fail noisily if unbound (\ with set -u). Or add a preamble check that errors if literal <plan_path> strings remain after substitution.

2. /office-hours prerequisite offer fires in non-interactive sessions

The "Prerequisite Skill Offer" block prints "No design doc found for this branch. /office-hours produces a structured problem statement... want to run it now?" and gates further progress on the user's answer. In smoke-test, automation, or CI contexts there's no human to answer. The skill has no SESSION_KIND=spawned short-circuit (unlike telemetry/proactive prompts which DO check it).

Fix: add SESSION_KIND guard at the top of the Prerequisite Skill Offer block, mirroring patterns used elsewhere in the preamble:

if [ "$_SESSION_KIND" = "spawned" ] || [ "$_SESSION_KIND" = "headless" ]; then
  echo "Prerequisite skill offer skipped (session kind: $_SESSION_KIND)"
fi

Filed via GitHub Copilot CLI by @aviraldua93 during stress-testing a downstream port.

aviraldua93 avatar Jun 10 '26 19:06 aviraldua93

Thanks for the careful read-through, @aviraldua93. The literal <plan_path> placeholders are gone (review inputs are now bound via the snapshot tool), and the /office-hours prerequisite offer is skipped in spawned and headless sessions since v1.69.0.0.

capy-ai[bot] avatar Oct 11 '26 14:10 capy-ai[bot]