Skip to content

[model-apps][Bug] /genpage bypasses the prompt-file upload wrapper and breaks quoted prompts on Windows #589

Description

Summary

The reusable GenPage CLI wrapper was fixed in #565 to pass prompt and agent-message text through --prompt-file / --agent-message-file, but the user-facing /genpage create and edit workflows still instruct the orchestrator to invoke raw pac model genpage upload with inline --prompt and --agent-message.

This leaves the main skill path exposed to the command-line quoting failures that the wrapper was created to avoid.

Live reproduction

An isolated live page deployment used the approved prompt containing an ASCII-quoted multiword page name:

Create and LIVE DEPLOY one isolated generative page named "Facilities Inspection Live CK1 Overview" ...

The direct upload command failed before mutation:

Error: Not a valid command.
Parse failed on: Inspection
Current command: upload
Was it quote wrapped? No, be sure to wrap values that contain spaces.

The failure reproduced through normal PowerShell invocation and through .NET ProcessStartInfo.ArgumentList; the PAC development shim reparsed its raw command line and split the embedded ASCII-quoted text.

The same prompt parsed and deployed only after replacing the two ASCII quote characters with typographic quotes:

named “Facilities Inspection Live CK1 Overview”

The page then created, published, attached to the sitemap, packaged into the solution, downloaded, and ran successfully.

Root cause

plugins/model-apps/scripts/lib/genpage-cli.js already has the safe implementation:

  • writes prompt/agent message to unique UTF-8 temp files;
  • passes --prompt-file and --agent-message-file;
  • cleans the temp directory on every exit path.

However, plugins/model-apps/skills/genpage/SKILL.md Phase 6 and edit-flow.md still:

  • require logging raw pac model genpage upload;
  • require inline --prompt "<full prompt>";
  • show direct PowerShell upload commands;
  • bypass makeGenpageCli().upload().

So /app-builder pages use the safe wrapper, while the standalone /genpage skill still uses the unsafe path.

Impact

  • Valid prompts with quotes or other shell-sensitive content can fail deployment.
  • Multi-line edit transcripts remain vulnerable to flattening/mangling on the standalone skill path.
  • Agents may mutate the approved prompt to work around quoting, weakening prompt provenance.
  • Behavior differs between /app-builder and /genpage despite sharing the same upload contract.

Expected

Route standalone create/edit deployment through one script/API backed by makeGenpageCli().upload() instead of constructing raw PAC commands in Markdown.

Logging should preserve the approved prompt semantically without requiring the full sensitive/arbitrary text to be embedded as an executable shell command. Add a live-shaped Windows regression test containing:

  • a multi-line prompt;
  • an ASCII-quoted multiword name;
  • Unicode;
  • shell metacharacters;
  • an update with a downloaded conversation transcript.

Related

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions