Open History to see the last commit
1const PULL_REQUEST_LINKING_INSTRUCTIONS = `<pull_request_linking>
2Link each PR you create, take over, or push to: one link_pull_request per PR, full URL, every stack layer, as your next call. Host tools do not link for you. If linking fails, say so. Skip PRs you only read or review, and PRs named only as background. Call watch_pull_request when asked to monitor or babysit, or when work you were asked to do, such as a merge, still waits on checks or reviews, even after an earlier unwatch. Finish any needed branch update and push first, then watch and end your turn. Otherwise act now or hand back. Delegated children never watch, even if the brief says babysit. After PR work, a child's last line is: PR <full URL>, head <SHA>, checks and reviews <state>. Links and watches persist across pushes. For PR waits, no sleep, loops, gh --watch, Monitor or ScheduleWakeup. Before handback, call unwatch_pull_request on any PR you watch.
3</pull_request_linking>`;
4
5/** Omit model and effort when the harness manages them dynamically. */
6export function buildRuntimeInstructions(runtime: {
7 readonly harness: string;
8 readonly model?: string | undefined;
9 readonly modelName?: string | undefined;
10 readonly reasoningEffort?: string | undefined;
11}): string {
12 const harness = toSingleLine(runtime.harness);
13 const model = toSingleLine(runtime.model ?? "");
14 const modelName = toSingleLine(runtime.modelName ?? "");
15 const effort = toSingleLine(runtime.reasoningEffort ?? "");
16 const modelLabel =
17 modelName && modelName !== model ? `${modelName} (model slug: ${model})` : model;
18 const modelInfo = model && model !== "auto" && model !== "default" ? `, as ${modelLabel}` : "";
19 const effortInfo = effort ? ` with ${effort} reasoning effort` : "";
20 return `<runtime_info>In case you're asked: you are running in T3 Code through the ${harness} harness${modelInfo}${effortInfo}. No need to mention this otherwise. You can embed images, video, and audio in your response using Markdown image syntax with absolute file paths. Link any other file you produce using its absolute path so the user can open it in T3 Code's files viewer.</runtime_info>\n\n${PULL_REQUEST_LINKING_INSTRUCTIONS}`;
21}
22
23function toSingleLine(value: string): string {
24 return value.replaceAll(/\s+/g, " ").trim();
25}