@oh-my-pi/pi-coding-agent 15.0.2 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -1
- package/examples/custom-tools/README.md +11 -7
- package/examples/custom-tools/hello/index.ts +2 -2
- package/examples/extensions/README.md +19 -8
- package/examples/extensions/api-demo.ts +15 -19
- package/examples/extensions/hello.ts +5 -6
- package/examples/extensions/plan-mode.ts +1 -1
- package/examples/extensions/reload-runtime.ts +4 -3
- package/examples/extensions/with-deps/index.ts +4 -3
- package/examples/sdk/06-extensions.ts +4 -2
- package/package.json +7 -17
- package/src/autoresearch/tools/init-experiment.ts +38 -41
- package/src/autoresearch/tools/log-experiment.ts +32 -41
- package/src/autoresearch/tools/run-experiment.ts +3 -3
- package/src/autoresearch/tools/update-notes.ts +11 -11
- package/src/commit/agentic/tools/analyze-file.ts +4 -4
- package/src/commit/agentic/tools/git-file-diff.ts +4 -4
- package/src/commit/agentic/tools/git-hunk.ts +5 -5
- package/src/commit/agentic/tools/git-overview.ts +4 -4
- package/src/commit/agentic/tools/propose-changelog.ts +13 -13
- package/src/commit/agentic/tools/propose-commit.ts +6 -6
- package/src/commit/agentic/tools/recent-commits.ts +3 -3
- package/src/commit/agentic/tools/schemas.ts +28 -28
- package/src/commit/agentic/tools/split-commit.ts +22 -21
- package/src/commit/analysis/summary.ts +4 -4
- package/src/commit/changelog/generate.ts +7 -11
- package/src/commit/shared-llm.ts +22 -34
- package/src/config/config-file.ts +35 -13
- package/src/config/model-registry.ts +9 -190
- package/src/config/models-config-schema.ts +166 -0
- package/src/config/settings-schema.ts +18 -0
- package/src/edit/index.ts +2 -2
- package/src/edit/modes/apply-patch.ts +7 -6
- package/src/edit/modes/patch.ts +18 -25
- package/src/edit/modes/replace.ts +18 -20
- package/src/eval/js/shared/rewrite-imports.ts +131 -10
- package/src/eval/py/executor.ts +233 -623
- package/src/eval/py/kernel.ts +27 -2
- package/src/exa/factory.ts +5 -4
- package/src/exa/mcp-client.ts +1 -1
- package/src/exa/researcher.ts +9 -20
- package/src/exa/search.ts +26 -52
- package/src/exa/types.ts +1 -1
- package/src/exa/websets.ts +54 -53
- package/src/exec/bash-executor.ts +2 -1
- package/src/extensibility/custom-commands/loader.ts +5 -3
- package/src/extensibility/custom-commands/types.ts +4 -2
- package/src/extensibility/custom-tools/loader.ts +5 -3
- package/src/extensibility/custom-tools/types.ts +7 -6
- package/src/extensibility/custom-tools/wrapper.ts +1 -1
- package/src/extensibility/extensions/loader.ts +7 -3
- package/src/extensibility/extensions/types.ts +9 -5
- package/src/extensibility/extensions/wrapper.ts +1 -2
- package/src/extensibility/hooks/loader.ts +3 -1
- package/src/extensibility/hooks/tool-wrapper.ts +1 -1
- package/src/extensibility/hooks/types.ts +4 -2
- package/src/extensibility/plugins/legacy-pi-compat.ts +30 -0
- package/src/extensibility/shared-events.ts +1 -1
- package/src/extensibility/typebox.ts +391 -0
- package/src/goals/tools/goal-tool.ts +6 -12
- package/src/hashline/types.ts +4 -4
- package/src/hindsight/state.ts +2 -2
- package/src/index.ts +0 -2
- package/src/internal-urls/docs-index.generated.ts +7 -7
- package/src/lsp/types.ts +30 -38
- package/src/mcp/manager.ts +1 -1
- package/src/mcp/tool-bridge.ts +1 -1
- package/src/modes/components/session-observer-overlay.ts +12 -1
- package/src/modes/components/status-line/segments.ts +2 -1
- package/src/modes/controllers/command-controller.ts +27 -2
- package/src/modes/controllers/event-controller.ts +3 -4
- package/src/modes/interactive-mode.ts +1 -1
- package/src/modes/rpc/host-tools.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +1 -1
- package/src/modes/rpc/rpc-types.ts +1 -1
- package/src/modes/theme/theme.ts +111 -117
- package/src/modes/types.ts +1 -1
- package/src/modes/utils/context-usage.ts +2 -2
- package/src/sdk.ts +31 -8
- package/src/session/agent-session.ts +74 -104
- package/src/session/messages.ts +16 -51
- package/src/session/session-manager.ts +22 -2
- package/src/session/streaming-output.ts +16 -6
- package/src/task/executor.ts +208 -86
- package/src/task/index.ts +15 -11
- package/src/task/render.ts +32 -5
- package/src/task/types.ts +54 -39
- package/src/tools/ask.ts +12 -12
- package/src/tools/ast-edit.ts +11 -15
- package/src/tools/ast-grep.ts +9 -10
- package/src/tools/bash.ts +9 -23
- package/src/tools/browser.ts +39 -53
- package/src/tools/calculator.ts +12 -11
- package/src/tools/checkpoint.ts +7 -7
- package/src/tools/debug.ts +40 -43
- package/src/tools/eval.ts +6 -8
- package/src/tools/find.ts +10 -13
- package/src/tools/gh.ts +71 -128
- package/src/tools/hindsight-recall.ts +4 -6
- package/src/tools/hindsight-reflect.ts +5 -5
- package/src/tools/hindsight-retain.ts +15 -17
- package/src/tools/image-gen.ts +31 -81
- package/src/tools/index.ts +4 -1
- package/src/tools/inspect-image.ts +8 -9
- package/src/tools/irc.ts +15 -27
- package/src/tools/job.ts +14 -21
- package/src/tools/read.ts +7 -8
- package/src/tools/recipe/index.ts +7 -9
- package/src/tools/render-mermaid.ts +12 -12
- package/src/tools/report-tool-issue.ts +4 -4
- package/src/tools/resolve.ts +11 -11
- package/src/tools/review.ts +14 -26
- package/src/tools/search-tool-bm25.ts +7 -9
- package/src/tools/search.ts +19 -22
- package/src/tools/ssh.ts +7 -7
- package/src/tools/todo-write.ts +26 -34
- package/src/tools/vim.ts +10 -26
- package/src/tools/write.ts +5 -5
- package/src/tools/yield.ts +100 -54
- package/src/web/search/index.ts +9 -24
- package/src/prompts/compaction/branch-summary-context.md +0 -5
- package/src/prompts/compaction/branch-summary-preamble.md +0 -2
- package/src/prompts/compaction/branch-summary.md +0 -30
- package/src/prompts/compaction/compaction-short-summary.md +0 -9
- package/src/prompts/compaction/compaction-summary-context.md +0 -5
- package/src/prompts/compaction/compaction-summary.md +0 -38
- package/src/prompts/compaction/compaction-turn-prefix.md +0 -17
- package/src/prompts/compaction/compaction-update-summary.md +0 -45
- package/src/prompts/system/auto-handoff-threshold-focus.md +0 -1
- package/src/prompts/system/file-operations.md +0 -10
- package/src/prompts/system/handoff-document.md +0 -49
- package/src/prompts/system/summarization-system.md +0 -3
- package/src/session/compaction/branch-summarization.ts +0 -324
- package/src/session/compaction/compaction.ts +0 -1420
- package/src/session/compaction/errors.ts +0 -31
- package/src/session/compaction/index.ts +0 -8
- package/src/session/compaction/pruning.ts +0 -91
- package/src/session/compaction/utils.ts +0 -184
package/src/tools/yield.ts
CHANGED
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* Subagents must call this tool to finish and return structured JSON output.
|
|
5
5
|
*/
|
|
6
6
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import type { TSchema } from "@oh-my-pi/pi-ai/types";
|
|
8
|
+
import {
|
|
9
|
+
dereferenceJsonSchema,
|
|
10
|
+
isValidJsonSchema,
|
|
11
|
+
type JsonSchemaValidationIssue,
|
|
12
|
+
type JsonSchemaValidationResult,
|
|
13
|
+
sanitizeSchemaForStrictMode,
|
|
14
|
+
validateJsonSchemaValue,
|
|
15
|
+
} from "@oh-my-pi/pi-ai/utils/schema";
|
|
11
16
|
import { subprocessToolRegistry } from "../task/subprocess-tool-registry";
|
|
12
17
|
import type { ToolSession } from ".";
|
|
13
18
|
import { jtdToJsonSchema, normalizeSchema } from "./jtd-to-json-schema";
|
|
@@ -18,8 +23,6 @@ export interface YieldDetails {
|
|
|
18
23
|
error?: string;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
const ajv = new Ajv({ allErrors: true, strict: false, logger: false });
|
|
22
|
-
|
|
23
26
|
function formatSchema(schema: unknown): string {
|
|
24
27
|
if (schema === undefined) return "No schema provided.";
|
|
25
28
|
if (typeof schema === "string") return schema;
|
|
@@ -30,16 +33,72 @@ function formatSchema(schema: unknown): string {
|
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
function
|
|
34
|
-
if (!
|
|
35
|
-
return
|
|
36
|
-
.map(
|
|
37
|
-
const path =
|
|
38
|
-
return `${path}${
|
|
36
|
+
function formatJsonSchemaIssues(issues: ReadonlyArray<JsonSchemaValidationIssue> | undefined): string {
|
|
37
|
+
if (!issues || issues.length === 0) return "Unknown schema validation error.";
|
|
38
|
+
return issues
|
|
39
|
+
.map(issue => {
|
|
40
|
+
const path = issue.path.length === 0 ? "" : `${issue.path.map(seg => String(seg)).join("/")}: `;
|
|
41
|
+
return `${path}${issue.message}`;
|
|
39
42
|
})
|
|
40
43
|
.join("; ");
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
function looseRecordSchema(description: string): Record<string, unknown> {
|
|
47
|
+
return {
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: true,
|
|
50
|
+
description,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function hasUnresolvedRefs(schema: unknown): boolean {
|
|
55
|
+
if (schema == null) return false;
|
|
56
|
+
if (Array.isArray(schema)) {
|
|
57
|
+
for (const item of schema) {
|
|
58
|
+
if (hasUnresolvedRefs(item)) return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (typeof schema !== "object") return false;
|
|
63
|
+
const record = schema as Record<string, unknown>;
|
|
64
|
+
if (typeof record.$ref === "string") return true;
|
|
65
|
+
for (const key in record) {
|
|
66
|
+
if (key === "const" || key === "default" || key === "enum" || key === "examples") continue;
|
|
67
|
+
if (hasUnresolvedRefs(record[key])) return true;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function wrapYieldParameters(dataSchema: Record<string, unknown>): Record<string, unknown> {
|
|
73
|
+
return {
|
|
74
|
+
type: "object",
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
description: "submit data or error",
|
|
77
|
+
properties: {
|
|
78
|
+
result: {
|
|
79
|
+
anyOf: [
|
|
80
|
+
{
|
|
81
|
+
type: "object",
|
|
82
|
+
additionalProperties: false,
|
|
83
|
+
description: "task succeeded",
|
|
84
|
+
properties: { data: dataSchema },
|
|
85
|
+
required: ["data"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "object",
|
|
89
|
+
additionalProperties: false,
|
|
90
|
+
properties: {
|
|
91
|
+
error: { type: "string", description: "error message" },
|
|
92
|
+
},
|
|
93
|
+
required: ["error"],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
required: ["result"],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
43
102
|
export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
44
103
|
readonly name = "yield";
|
|
45
104
|
readonly label = "Submit Result";
|
|
@@ -52,33 +111,15 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
|
52
111
|
readonly intent = "omit" as const;
|
|
53
112
|
lenientArgValidation = true;
|
|
54
113
|
|
|
55
|
-
readonly #validate?:
|
|
114
|
+
readonly #validate?: (value: unknown) => JsonSchemaValidationResult;
|
|
56
115
|
#schemaValidationFailures = 0;
|
|
57
116
|
|
|
58
117
|
constructor(session: ToolSession) {
|
|
59
|
-
|
|
60
|
-
Type.Object(
|
|
61
|
-
{
|
|
62
|
-
result: Type.Union([
|
|
63
|
-
Type.Object({ data: dataSchema }, { description: "task succeeded" }),
|
|
64
|
-
Type.Object({
|
|
65
|
-
error: Type.String({ description: "error message" }),
|
|
66
|
-
}),
|
|
67
|
-
]),
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
additionalProperties: false,
|
|
71
|
-
description: "submit data or error",
|
|
72
|
-
},
|
|
73
|
-
) as TSchema;
|
|
74
|
-
|
|
75
|
-
let validate: ValidateFunction | undefined;
|
|
76
|
-
let dataSchema: TSchema;
|
|
118
|
+
let validate: ((value: unknown) => JsonSchemaValidationResult) | undefined;
|
|
77
119
|
let parameters: TSchema;
|
|
78
120
|
|
|
79
121
|
try {
|
|
80
122
|
const schemaResult = normalizeSchema(session.outputSchema);
|
|
81
|
-
// Convert JTD to JSON Schema if needed (auto-detected)
|
|
82
123
|
const normalizedSchema =
|
|
83
124
|
schemaResult.normalized !== undefined ? jtdToJsonSchema(schemaResult.normalized) : undefined;
|
|
84
125
|
let schemaError = schemaResult.error;
|
|
@@ -88,10 +129,10 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
|
88
129
|
}
|
|
89
130
|
|
|
90
131
|
if (normalizedSchema !== undefined && normalizedSchema !== false && !schemaError) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
132
|
+
if (!isValidJsonSchema(normalizedSchema)) {
|
|
133
|
+
schemaError = "invalid JSON schema";
|
|
134
|
+
} else {
|
|
135
|
+
validate = value => validateJsonSchemaValue(normalizedSchema, value);
|
|
95
136
|
}
|
|
96
137
|
}
|
|
97
138
|
|
|
@@ -109,27 +150,29 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
|
109
150
|
? {}
|
|
110
151
|
: undefined;
|
|
111
152
|
|
|
153
|
+
let dataSchema: Record<string, unknown>;
|
|
112
154
|
if (sanitizedSchema !== undefined) {
|
|
113
155
|
const resolved = dereferenceJsonSchema({
|
|
114
156
|
...sanitizedSchema,
|
|
115
157
|
description: schemaDescription,
|
|
116
|
-
})
|
|
117
|
-
|
|
158
|
+
}) as Record<string, unknown>;
|
|
159
|
+
if (hasUnresolvedRefs(resolved)) {
|
|
160
|
+
throw new Error("schema contains unresolved $ref after dereferencing");
|
|
161
|
+
}
|
|
162
|
+
dataSchema = resolved;
|
|
118
163
|
} else {
|
|
119
|
-
dataSchema =
|
|
120
|
-
|
|
121
|
-
|
|
164
|
+
dataSchema = looseRecordSchema(
|
|
165
|
+
schemaError ? schemaDescription : "Structured JSON output (no schema specified)",
|
|
166
|
+
);
|
|
122
167
|
}
|
|
123
|
-
parameters =
|
|
168
|
+
parameters = wrapYieldParameters(dataSchema);
|
|
124
169
|
JSON.stringify(parameters);
|
|
125
|
-
|
|
126
|
-
ajv.compile(parameters as Record<string, unknown>);
|
|
170
|
+
if (!isValidJsonSchema(parameters)) throw new Error("yield parameters schema is invalid");
|
|
127
171
|
} catch (err) {
|
|
128
172
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
parameters = createParameters(dataSchema);
|
|
173
|
+
parameters = wrapYieldParameters(
|
|
174
|
+
looseRecordSchema(`Structured JSON output (schema processing failed: ${errorMsg})`),
|
|
175
|
+
);
|
|
133
176
|
validate = undefined;
|
|
134
177
|
this.strict = false;
|
|
135
178
|
}
|
|
@@ -140,7 +183,7 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
|
140
183
|
|
|
141
184
|
async execute(
|
|
142
185
|
_toolCallId: string,
|
|
143
|
-
params:
|
|
186
|
+
params: unknown,
|
|
144
187
|
_signal?: AbortSignal,
|
|
145
188
|
_onUpdate?: AgentToolUpdateCallback<YieldDetails>,
|
|
146
189
|
_context?: AgentToolContext,
|
|
@@ -170,12 +213,15 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
|
|
|
170
213
|
if (data === undefined || data === null) {
|
|
171
214
|
throw new Error("data is required when yield indicates success");
|
|
172
215
|
}
|
|
173
|
-
if (this.#validate
|
|
174
|
-
this.#
|
|
175
|
-
if (
|
|
176
|
-
|
|
216
|
+
if (this.#validate) {
|
|
217
|
+
const parsed = this.#validate(data);
|
|
218
|
+
if (!parsed.success) {
|
|
219
|
+
this.#schemaValidationFailures++;
|
|
220
|
+
if (this.#schemaValidationFailures <= 1) {
|
|
221
|
+
throw new Error(`Output does not match schema: ${formatJsonSchemaIssues(parsed.issues)}`);
|
|
222
|
+
}
|
|
223
|
+
schemaValidationOverridden = true;
|
|
177
224
|
}
|
|
178
|
-
schemaValidationOverridden = true;
|
|
179
225
|
}
|
|
180
226
|
}
|
|
181
227
|
|
package/src/web/search/index.ts
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
9
|
-
import { StringEnum } from "@oh-my-pi/pi-ai";
|
|
10
9
|
import { prompt } from "@oh-my-pi/pi-utils";
|
|
11
|
-
import
|
|
10
|
+
import * as z from "zod/v4";
|
|
12
11
|
import type { CustomTool, CustomToolContext, RenderResultOptions } from "../../extensibility/custom-tools/types";
|
|
13
12
|
import type { Theme } from "../../modes/theme/theme";
|
|
14
13
|
import webSearchSystemPrompt from "../../prompts/system/web-search.md" with { type: "text" };
|
|
@@ -21,30 +20,16 @@ import type { SearchProviderId, SearchResponse } from "./types";
|
|
|
21
20
|
import { SearchProviderError } from "./types";
|
|
22
21
|
|
|
23
22
|
/** Web search tool parameters schema */
|
|
24
|
-
export const webSearchSchema =
|
|
25
|
-
query:
|
|
26
|
-
recency:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
),
|
|
31
|
-
limit: Type.Optional(Type.Number({ description: "Max results to return" })),
|
|
32
|
-
max_tokens: Type.Optional(Type.Number({ description: "Maximum output tokens" })),
|
|
33
|
-
temperature: Type.Optional(Type.Number({ description: "Sampling temperature" })),
|
|
34
|
-
num_search_results: Type.Optional(Type.Number({ description: "Number of search results to retrieve" })),
|
|
23
|
+
export const webSearchSchema = z.object({
|
|
24
|
+
query: z.string().describe("Search query"),
|
|
25
|
+
recency: z.enum(["day", "week", "month", "year"]).describe("Recency filter (Brave, Perplexity)").optional(),
|
|
26
|
+
limit: z.number().describe("Max results to return").optional(),
|
|
27
|
+
max_tokens: z.number().describe("Maximum output tokens").optional(),
|
|
28
|
+
temperature: z.number().describe("Sampling temperature").optional(),
|
|
29
|
+
num_search_results: z.number().describe("Number of search results to retrieve").optional(),
|
|
35
30
|
});
|
|
36
31
|
|
|
37
|
-
export type SearchToolParams =
|
|
38
|
-
query: string;
|
|
39
|
-
recency?: "day" | "week" | "month" | "year";
|
|
40
|
-
limit?: number;
|
|
41
|
-
/** Maximum output tokens. Defaults to 4096. */
|
|
42
|
-
max_tokens?: number;
|
|
43
|
-
/** Sampling temperature (0–1). Lower = more focused/factual. Defaults to 0.2. */
|
|
44
|
-
temperature?: number;
|
|
45
|
-
/** Number of search results to retrieve. Defaults to 10. */
|
|
46
|
-
num_search_results?: number;
|
|
47
|
-
};
|
|
32
|
+
export type SearchToolParams = z.infer<typeof webSearchSchema>;
|
|
48
33
|
|
|
49
34
|
export interface SearchQueryParams extends SearchToolParams {
|
|
50
35
|
provider?: SearchProviderId | "auto";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
You MUST create a structured summary of the conversation branch for context when returning.
|
|
2
|
-
|
|
3
|
-
You MUST use EXACT format:
|
|
4
|
-
|
|
5
|
-
## Goal
|
|
6
|
-
|
|
7
|
-
[What user trying to accomplish in this branch?]
|
|
8
|
-
|
|
9
|
-
## Constraints & Preferences
|
|
10
|
-
- [Constraints, preferences, requirements mentioned]
|
|
11
|
-
- [(none) if none mentioned]
|
|
12
|
-
|
|
13
|
-
## Progress
|
|
14
|
-
|
|
15
|
-
### Done
|
|
16
|
-
- [x] [Completed tasks/changes]
|
|
17
|
-
|
|
18
|
-
### In Progress
|
|
19
|
-
- [ ] [Work started but not finished]
|
|
20
|
-
|
|
21
|
-
### Blocked
|
|
22
|
-
- [Issues preventing progress]
|
|
23
|
-
|
|
24
|
-
## Key Decisions
|
|
25
|
-
- **[Decision]**: [Brief rationale]
|
|
26
|
-
|
|
27
|
-
## Next Steps
|
|
28
|
-
1. [What should happen next to continue]
|
|
29
|
-
|
|
30
|
-
Sections MUST be kept concise. You MUST preserve exact file paths, function names, error messages.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
You MUST summarize what was done in this conversation, written like a pull request description.
|
|
2
|
-
|
|
3
|
-
Rules:
|
|
4
|
-
- MUST be 2-3 sentences max
|
|
5
|
-
- MUST describe the changes made, not the process
|
|
6
|
-
- NEVER mention running tests, builds, or other validation steps
|
|
7
|
-
- NEVER explain what the user asked for
|
|
8
|
-
- MUST write in first person (I added…, I fixed…)
|
|
9
|
-
- NEVER ask questions
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. You MUST use this to build on the work that has already been done and NEVER duplicate work. Here is the summary produced by the other language model; you MUST use the information in this summary to assist with your own analysis:
|
|
2
|
-
|
|
3
|
-
<summary>
|
|
4
|
-
{{summary}}
|
|
5
|
-
</summary>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
You MUST summarize the conversation above into a structured context checkpoint handoff summary for another LLM to resume task.
|
|
2
|
-
|
|
3
|
-
IMPORTANT: If conversation ends with unanswered question to user or imperative/request awaiting user response (e.g., "Please run command and paste output"), you MUST preserve that exact question/request.
|
|
4
|
-
|
|
5
|
-
You MUST use this format (sections can be omitted if not applicable):
|
|
6
|
-
|
|
7
|
-
## Goal
|
|
8
|
-
[User goals; list multiple if session covers different tasks.]
|
|
9
|
-
|
|
10
|
-
## Constraints & Preferences
|
|
11
|
-
- [Constraints or requirements mentioned]
|
|
12
|
-
|
|
13
|
-
## Progress
|
|
14
|
-
|
|
15
|
-
### Done
|
|
16
|
-
- [x] [Completed tasks/changes]
|
|
17
|
-
|
|
18
|
-
### In Progress
|
|
19
|
-
- [ ] [Current work]
|
|
20
|
-
|
|
21
|
-
### Blocked
|
|
22
|
-
- [Issues preventing progress]
|
|
23
|
-
|
|
24
|
-
## Key Decisions
|
|
25
|
-
- **[Decision]**: [Brief rationale]
|
|
26
|
-
|
|
27
|
-
## Next Steps
|
|
28
|
-
1. [Ordered list of next actions]
|
|
29
|
-
|
|
30
|
-
## Critical Context
|
|
31
|
-
- [Important data, pending questions, references]
|
|
32
|
-
|
|
33
|
-
## Additional Notes
|
|
34
|
-
[Anything else important not covered above]
|
|
35
|
-
|
|
36
|
-
You MUST output only the structured summary; you NEVER include extra text.
|
|
37
|
-
|
|
38
|
-
Sections MUST be kept concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
|
|
2
|
-
|
|
3
|
-
You MUST summarize the prefix to provide context for the retained suffix:
|
|
4
|
-
|
|
5
|
-
## Original Request
|
|
6
|
-
|
|
7
|
-
[What did the user ask for in this turn?]
|
|
8
|
-
|
|
9
|
-
## Early Progress
|
|
10
|
-
- [Key decisions and work done in the prefix]
|
|
11
|
-
|
|
12
|
-
## Context for Suffix
|
|
13
|
-
- [Information needed to understand the retained recent work]
|
|
14
|
-
|
|
15
|
-
You MUST output only the structured summary. You NEVER include extra text.
|
|
16
|
-
|
|
17
|
-
You MUST be concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results if they appear. You MUST focus on what's needed to understand the kept suffix.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
You MUST incorporate new messages above into the existing handoff summary in <previous-summary> tags, used by another LLM to resume task.
|
|
2
|
-
RULES:
|
|
3
|
-
- MUST preserve all information from previous summary
|
|
4
|
-
- MUST add new progress, decisions, and context from new messages
|
|
5
|
-
- MUST update Progress: move items from "In Progress" to "Done" when completed
|
|
6
|
-
- MUST update "Next Steps" based on what was accomplished
|
|
7
|
-
- MUST preserve exact file paths, function names, and error messages
|
|
8
|
-
- You MAY remove anything no longer relevant
|
|
9
|
-
|
|
10
|
-
IMPORTANT: If new messages end with unanswered question or request to user, you MUST add it to Critical Context (replacing any previous pending question if answered).
|
|
11
|
-
|
|
12
|
-
You MUST use this format (omit sections if not applicable):
|
|
13
|
-
|
|
14
|
-
## Goal
|
|
15
|
-
[Preserve existing goals; add new ones if task expanded]
|
|
16
|
-
|
|
17
|
-
## Constraints & Preferences
|
|
18
|
-
- [Preserve existing; add new ones discovered]
|
|
19
|
-
|
|
20
|
-
## Progress
|
|
21
|
-
|
|
22
|
-
### Done
|
|
23
|
-
- [x] [Include previously done and newly completed items]
|
|
24
|
-
|
|
25
|
-
### In Progress
|
|
26
|
-
- [ ] [Current work—update based on progress]
|
|
27
|
-
|
|
28
|
-
### Blocked
|
|
29
|
-
- [Current blockers—remove if resolved]
|
|
30
|
-
|
|
31
|
-
## Key Decisions
|
|
32
|
-
- **[Decision]**: [Brief rationale] (preserve all previous, add new)
|
|
33
|
-
|
|
34
|
-
## Next Steps
|
|
35
|
-
1. [Update based on current state]
|
|
36
|
-
|
|
37
|
-
## Critical Context
|
|
38
|
-
- [Preserve important context; add new if needed]
|
|
39
|
-
|
|
40
|
-
## Additional Notes
|
|
41
|
-
[Other important info not fitting above]
|
|
42
|
-
|
|
43
|
-
You MUST output only the structured summary; you NEVER include extra text.
|
|
44
|
-
|
|
45
|
-
Sections MUST be kept concise. You MUST preserve relevant tool outputs/command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Threshold-triggered maintenance: preserve critical implementation state and immediate next actions.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<critical>
|
|
2
|
-
Write a handoff document for another instance of yourself.
|
|
3
|
-
The handoff MUST be sufficient for seamless continuation without access to this conversation.
|
|
4
|
-
Output ONLY the handoff document. No preamble, no commentary, no wrapper text.
|
|
5
|
-
</critical>
|
|
6
|
-
|
|
7
|
-
<instruction>
|
|
8
|
-
Capture exact technical state, not abstractions.
|
|
9
|
-
- File paths, symbol names, commands run
|
|
10
|
-
- Test results, observed failures
|
|
11
|
-
- Decisions made
|
|
12
|
-
- Partial work affecting the next step
|
|
13
|
-
</instruction>
|
|
14
|
-
|
|
15
|
-
<output>
|
|
16
|
-
Use exactly this structure:
|
|
17
|
-
|
|
18
|
-
## Goal
|
|
19
|
-
[What the user is trying to accomplish]
|
|
20
|
-
|
|
21
|
-
## Constraints & Preferences
|
|
22
|
-
- [Any constraints, preferences, or requirements mentioned]
|
|
23
|
-
|
|
24
|
-
## Progress
|
|
25
|
-
### Done
|
|
26
|
-
- [x] [Completed tasks with specifics]
|
|
27
|
-
|
|
28
|
-
### In Progress
|
|
29
|
-
- [ ] [Current work if any]
|
|
30
|
-
|
|
31
|
-
### Pending
|
|
32
|
-
- [ ] [Tasks mentioned but not started]
|
|
33
|
-
|
|
34
|
-
## Key Decisions
|
|
35
|
-
- **[Decision]**: [Rationale]
|
|
36
|
-
|
|
37
|
-
## Critical Context
|
|
38
|
-
- Code snippets, file paths, function/type names, error messages, data essential to continue
|
|
39
|
-
- Repository state if relevant
|
|
40
|
-
|
|
41
|
-
## Next Steps
|
|
42
|
-
1. [What should happen next]
|
|
43
|
-
</output>
|
|
44
|
-
|
|
45
|
-
{{#if additionalFocus}}
|
|
46
|
-
<instruction>
|
|
47
|
-
Additional focus: {{additionalFocus}}
|
|
48
|
-
</instruction>
|
|
49
|
-
{{/if}}
|