test(snapshot): refresh the ptc-script-imports system prompt (#7738)

* test(snapshot): refresh the ptc-script-imports system prompt

The pinned prompt kept the fs-observation wording from before the apply_patch guidance
landed, so the scenario failed on the prompt after the session records matched.

* test(snapshot): carry the current tool declarations into the ptc-script-imports prompt

The pinned prompt still listed the tools from before `apply_patch` and `wait_agent`
landed and before the subagent tool docs changed; the tool block now matches the
current declarations, the same 51 added and 12 removed lines CI reported.

---------

Co-authored-by: imccyu <imccyu@users.noreply.github.com>
This commit is contained in:
imccyu
2026-11-02 20:55:02 +08:00
committed by GitHub
co-authored by imccyu
parent 07f2b259e7
commit bedcb559ac
@@ -9,11 +9,13 @@ Verify your work by running the code or tests. Keep answers brief and factual.
Check the [exit code: N] marker on every bash result; investigate failures before moving on.
Use the read tool — not shell commands like cat — to inspect text files. Use offset and limit to continue reading large files.
Use the read tool — not shell commands like cat, sed, head, or tail — to inspect text files. Use offset and limit to read a line range or continue a large file.
Read an existing file before overwriting it with write (the default fs-observation-policy requires it) and prefer edit for targeted changes.
Read an existing file before overwriting it with write and prefer edit for targeted changes.
Read a file before editing it (the default fs-observation-policy requires it), unless you just created or edited it in this session.
Read a file before editing it unless you just created or edited it in this session.
Prefer apply_patch over separate edit calls for changes across files or separated regions. Give every hunk enough surrounding context lines to match one place in the current file. The whole patch is checked first (syntax, hunk matching, missing files) and a rejected patch changes nothing; once applying starts, operations run in order, stop at the first failure, and are not rolled back, so re-read affected files before retrying when needed.
Use the glob tool — not shell find — to discover files by path pattern.
@@ -29,7 +31,9 @@ create_goal may infer goal intent from a direct human request in any language. A
Use the workflow tool ONLY when the user explicitly asks for a workflow or for large multi-agent orchestration: you write a JavaScript script (the tool description documents the exact format) that fans work out across many subagents with phases and structured results. For one or two delegations, prefer plain subagent calls.
Start independent delegations with `subagent` or `subagent_fork` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn.
Start independent delegations with `subagent` or `subagent_fork` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn. Collect the subagent results required to complete the task before giving the user a final answer.
Agents may use different working directories; changes to shared files affect other agents. Split parallel write work into disjoint file or directory scopes. Bash, formatters, code generators, and scripts can overwrite concurrent edits without conflict detection; coordinate their changes explicitly. The agent integrating the work must review the final diff and run relevant tests.
## Writing code for run_code
@@ -50,6 +54,15 @@ Program-only SDK bindings:
type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }
interface ToolArgsMap {
/** Create, update, delete, or move UTF-8 text files with one Codex-style patch; prefer it over multiple edit calls when a change spans several files or separated regions. */
apply_patch: {
/** Codex patch text: start with *** Begin Patch and end with *** End Patch. Use *** Add File: path with + lines; *** Update File: path, optionally followed by *** Move to: path, with @@ or @@ context and space-prefixed context, + added, or - removed lines; *** End of File anchors the last hunk to the file end. Use *** Delete File: path to delete. Paths are relative to the Session working directory. */
input: string;
/** The narrowest wider sandbox mode for a one-shot retry of the exact operation the sandbox just denied; the retry asks the user for approval. */
sandbox_permissions?: "workspace-write" | "danger-full-access";
/** Required with sandbox_permissions: one sentence for the user explaining why this exact file operation needs the wider access. Use the language of the user’s current request. */
justification?: string;
} & Record<string, JsonValue>;
/** Execute a bash command (`bash -c`) and return its stdout/stderr. Each call runs in a fresh shell; pass `workdir` instead of using `cd`. Managed `$DSH_*` variables expose current harness environment facts. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. Provide `description` before `command` in the arguments. Before any delete or move, verify that the resolved absolute target path is the intended one; never run it against a computed path you have not checked. An unset variable expands to an empty string, so guard variables in such paths with `${VAR:?}`. Commands may run under a file sandbox; a blocked file operation is reported as `[sandbox: file access denied under <mode> mode]`, a policy denial: do not retry another way. */
bash: {
/** Clear, concise description of what this command does in active voice, 5-10 words (shown in the UI). Examples: "ls" → "List files in current directory"; "git status" → "Show working tree status"; "npm install" → "Install package dependencies". */
@@ -107,7 +120,7 @@ interface ToolArgsMap {
/** One glob filter for which files to search (e.g. "*.ts", "*.{js,jsx}"). Not a list; negation is not supported. */
include?: string;
} & Record<string, JsonValue>;
/** Ask a subagent to stop its current work. This call returns without waiting for it to stop. You can continue a local direct child's conversation later with send_message. External executions stop permanently and cannot receive follow-ups. Subagents it started will keep running. */
/** Ask a subagent to stop its current work. This call returns without waiting for it to stop. You can continue a local subagent's conversation later with send_message. External executions stop permanently and cannot receive follow-ups. Subagents it started will keep running. */
interrupt_agent: {
/** The id of an agent created under you: your direct child or a deeper descendant. */
agent_id: string;
@@ -130,11 +143,8 @@ interface ToolArgsMap {
/** Max wait in milliseconds with wait: true. Defaults to and is capped by configuration. */
timeout_ms?: number;
} & Record<string, JsonValue>;
/** List subagents you started, with their ids, labels, and status. running means it is working; inactive means it is not currently working. You will be notified when a subagent finishes; there is no need to keep checking its status. Use send_message to continue the conversation. */
list_agents: {
/** children (default) lists direct children, which accept send_message in any status. descendants lists the whole tree below you with each entry's parent session id and depth; entries deeper than 1 accept only interrupt_agent. */
scope?: "children" | "descendants";
} & Record<string, JsonValue>;
/** List your entire subagent tree: the root agent and all reachable continuable descendants, including yourself. Rows carry ids, descriptions, and status; descendant rows carry parent ids and depth from the root. You can message any other agent in the subagent tree listed as running or inactive. running means it is working; inactive means no turn is executing; it does not indicate task completion, success, or failure. While you remain active, you will be notified when a direct child finishes; there is no need to keep checking its status. Use send_message to continue the conversation. */
list_agents: Record<string, JsonValue>;
/** Read a UTF-8 text file and return line-numbered content. */
read: {
/** Path to read, resolved by the filesystem backend. */
@@ -149,9 +159,9 @@ interface ToolArgsMap {
/** Path to the image file, resolved by the filesystem backend. */
file_path: string;
} & Record<string, JsonValue>;
/** Send a message to an agent. A working agent receives it at its next step; an idle agent starts a new turn with it. Returns delivery confirmation, not the agent's answer. */
/** Send a message to an agent. A working agent receives it at its next step; an idle agent starts a new turn with it. Returns delivery confirmation. */
send_message: {
/** The agent id of your direct continuable child, or your direct parent when you are a resident continuable child. */
/** The agent id of another member of your subagent tree, as shown by list_agents. */
agent_id: string;
/** The message to deliver to the agent. */
message: string;
@@ -161,20 +171,20 @@ interface ToolArgsMap {
/** The exact skill name from the available skills list. */
name: string;
} & Record<string, JsonValue>;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. The runtime notifies you when it finishes. The child reports results with `send_message`; use `send_message` to steer it while running or continue its conversation after it finishes. */
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
/** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. */
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs. */
prompt: string;
} & Record<string, JsonValue>;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. The runtime notifies you when it finishes. The child reports results with `send_message`; use `send_message` to steer it while running or continue its conversation after it finishes. */
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
/** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. */
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** The task for the subagent. It already sees this conversation's completed turns, so build on them freely and state only what is new. */
prompt: string;
@@ -208,6 +218,11 @@ interface ToolArgsMap {
/** Required only with action blocked: the concrete condition that persisted across rounds and blocks progress. */
blocked_reason?: string;
} & Record<string, JsonValue>;
/** Wait for input at your next step, including agent messages, completion notifications, and user steering. Returns immediately when that input is already pending. */
wait_agent: {
/** Wait duration in milliseconds, from 10000 through 3600000. Defaults to 30000. */
timeout_ms?: number;
} & Record<string, JsonValue>;
/** Fetch the content of a specific HTTP(S) URL and return it decoded to text. */
web_fetch: {
/** The HTTP(S) URL to fetch. */
@@ -266,6 +281,27 @@ interface ToolArgsMap {
}
interface ToolOutputMap {
apply_patch: {
phase: "commit";
cancelled: boolean;
operations: ({
index: number;
kind: "add" | "update" | "delete" | "move";
path: string;
destination?: string;
patchLine: number;
status: "completed" | "failed" | "unknown" | "skipped";
code?: string;
message?: string;
hunkLine?: number;
changes?: ({
path: string;
before: string | null;
after: string | null;
})[];
})[];
affectedPaths: string[];
};
bash: {
kind: "background";
jobId: string;
@@ -390,6 +426,10 @@ interface ToolOutputMap {
};
};
list_agents: ({
kind: "root";
id: string;
status: "running" | "inactive";
} | {
kind: "child";
id: string;
label: string;
@@ -484,6 +524,9 @@ interface ToolOutputMap {
};
activation: "armed" | "disarmed";
};
wait_agent: {
timedOut: boolean;
};
web_fetch: {
url: string;
statusCode: number;