mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 11:47:42 +01:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Native Runner agents coordinate tasks, progress updates, and
searches through semantic protocol tools (`create_task`,
`report_progress`, `search_tasks`, `get_task_context`, and
`get_task_history`)
> - Headless API clients already use channels, key-value labels
(`kvLabels`), validated `<name>@<version>` schema blocks
(`schemaBlocks`), and required completion schemas (`resultSchemaRef`),
while native Runner tools omitted those fields
> - Because native Runner tools omitted those fields, native agents
could not file tasks into channels, filter task searches by channel or
label, attach structured schema blocks to progress updates, or verify
`resultSchemaRef` before completion
> - This pull request adds channel, `kvLabels`, `schemaBlocks`, and
`resultSchemaRef` support across native Runner tool schemas, authority
handlers, completion validation, and `skills/paperclip/SKILL.md`
> - The benefit is full structured-metadata and channel parity for
native Runner agents while preserving strict provider tool schemas,
private channel boundaries, and upgrade-safe receipt replay
## Linked Issues or Issue Description
**What existing behavior does this improve?**
Native Runner task tools (`create_task`, `report_progress`,
`search_tasks`, `get_task_context`, and `get_task_history`), native
deliverable completion checks (`validateNativeDeliverableEvidence`), and
`skills/paperclip/SKILL.md`.
**Subsystem affected**
Cross-cutting (multiple of the above)
**Current behavior**
Currently, native Runner semantic tools (`create_task`,
`report_progress`, and `search_tasks`) do not accept `kvLabels`,
`channel`, `labelFilter`, `schemaBlocks`, or `resultSchemaRef`. Read
tools (`get_task_context`, `get_task_history`, and `search_tasks`) omit
`channelId`, `channelPath`, `kvLabels`, `resultSchemaRef`, and
`schemaBlocks`. In addition, `validateNativeDeliverableEvidence` does
not check `issues.resultSchemaRef` before a native run marks a task
`done`.
**Proposed behavior**
`create_task` accepts optional `kvLabels`, `resultSchemaRef`, and
`channel` inputs and returns `channelId`, `channelPath`, `kvLabels`, and
`resultSchemaRef` on `result.task`. `report_progress` accepts optional
`kvLabels` and `schemaBlocks` inputs and extracts `json
schema=<name>@<version>` fenced blocks from `body` with a single-pass
`O(N)` line scanner. `search_tasks` accepts optional `labelFilter` and
`channel` filters (exact path, subtree prefix, or UUID) while preserving
cursor pagination and private channel access checks. `get_task_context`
and `search_tasks` return `channelId`, `channelPath`, `kvLabels`,
`resultSchemaRef`, and `schemaBlocks`, and `get_task_history` returns
`actorProfile`, `kvLabels`, and `schemaBlocks` (clearing metadata on
quarantined comments for higher-trust readers). When
`issues.resultSchemaRef` is set, `validateNativeDeliverableEvidence`
requires a valid matching JSON payload before completion, and final
reply comments persist valid fenced schema blocks onto
`issue_comments.schema_blocks`.
**Reason and benefit**
Agents running on the native Runner protocol need the same channel
routing, key-value metadata, and structured JSON schema contracts that
REST and headless workflows use. Enforcing `resultSchemaRef` at the
native deliverable gate prevents native runs from closing tasks without
valid structured output.
**Breaking changes**
None. All new tool input and output properties are optional. Existing
tool calls and saved mutation receipts without the new fields continue
to validate and replay without change.
**Additional context**
Tool input schemas use strict provider-portable array entries for
`kvLabels` (`{ key, value }`) and `schemaBlocks` (`{ schema, version,
dataJson }`) so OpenAI/Codex dynamic tools, AgentCore inline schemas,
Ajv strict mode, and RE2 checks all pass without open object maps.
## What Changed
- Extend `create_task`, `report_progress`, and `search_tasks` in
`packages/paperclip-runner/src/protocol-actions/` and
`src/catalog/semantic-action-catalog.ts`, and regenerate contract
manifests, capability YAML/Markdown, capability inventory, and seeded
eval fixtures.
- Add `native-schema-fences.ts`, `native-task-channels.ts`, and
`native-result-schema-gate.ts` (re-exported by
`native-task-metadata.ts`) with a linear `O(N)` single-pass CommonMark
fence scanner (`scanFencedSchemaBlocks`), `kvLabels` normalization,
transactional `schemaBlocks` persistence, a 128 KiB response-wide
`schemaBlocks` budget with truncation metadata, private-channel
authorization helpers, and run-scoped
`assertNativeResultSchemaSatisfied`.
- Update `PaperclipRunnerToolAuthority` (`get_task_context`,
`get_task_history`, `search_tasks`, `#reportProgress`, and
`#createTask`) for read/write parity, private-channel redaction,
quarantined comment `actorProfile`/`kvLabels`/`schemaBlocks` redaction,
and `channel` scope inclusion on filtered searches.
- Wire `assertNativeResultSchemaSatisfied` into
`validateNativeDeliverableEvidence` and persist valid fenced schema
blocks on final reply comments in `native-run-finalizer.ts` and
`run-completion.ts`.
- Document `kvLabels`, `channelPath`, `schemaBlocks`, `resultSchemaRef`,
and `PATCH /api/issues/{issueId}/kv-labels` in
`skills/paperclip/SKILL.md`.
- Add unit, ReDoS linear-time (`< 50ms` on 5,000 unclosed fences),
integration, private-channel, completion-gate, and upgrade-cutover
receipt replay tests.
## Verification
- `pnpm --filter @paperclipai/paperclip-runner typecheck:typescript`
- `pnpm --filter @paperclipai/paperclip-runner check:protocol-manifest`
- `pnpm --filter @paperclipai/paperclip-runner
check:capability-contract`
- `pnpm --filter @paperclipai/paperclip-runner check:semantic-contracts`
- `pnpm --filter @paperclipai/paperclip-runner
check:semantic-action-catalog`
- `pnpm --filter @paperclipai/paperclip-runner check:replay-goldens`
- `pnpm --filter @paperclipai/paperclip-runner test:typescript:prep`
- `pnpm --filter @paperclipai/paperclip-runner check:static`
- `pnpm --filter @paperclipai/paperclip-runner check:api-authority`
- `pnpm --filter @paperclipai/paperclip-runner exec vitest run
src/protocol-actions/collaboration-contracts.test.ts
src/protocol-actions/core-contracts.test.ts
src/catalog/semantic-action-catalog.test.ts
src/contracts/provider-tool-schema-shape.test.ts
src/drivers/runner-tool-bridge.schemas.test.ts
src/evals/native-execution.test.ts
src/semantic-tools/semantic-tools.test.ts
src/mock-core/capability-mock-control-plane-adapter.test.ts`
- `node
packages/paperclip-runner/scripts/contracts/contract-fingerprints.test.mjs`
- `(cd server && node scripts/typecheck-layers.mjs)`
- `node scripts/check-test-budget.mjs`
- `pnpm --filter @paperclipai/server exec vitest run
src/services/native-runtime/native-task-metadata.test.ts
src/services/native-runtime/tool-input-variant-admission.test.ts
src/services/native-runtime/native-completion-feedback.test.ts
src/services/native-runtime/paperclip-runner-tool-authority.test.ts`
## Risks
- **Upgrade-safe run state carry-forward
(`rules/upgrade-safe-run-state.mdc`)**: In-flight native runs started on
a previous release may carry saved `semanticToolReceipts` in
`heartbeat_runs.result_json` for `create_task` and `report_progress`
without `kvLabels`, `resultSchemaRef`, `channel`, or `schemaBlocks`. All
new fields are optional, `#withMutationReceipt` hashes raw caller
`input` without mutating missing keys, and `create_task`
`outputSchema.properties.task.required` is unchanged. Previous-release
receipts replay identically on `recover()` and `execute()` without
re-running effects, verified by a dedicated cutover test in
`paperclip-runner-tool-authority.test.ts`.
- **Markdown scanning safety**: Fenced schema extraction uses a bounded
`O(N)` line scanner (512 KiB max markdown scan, 64 KiB max fence body,
64 max candidate fences, zero multi-line backreference regular
expressions) so untrusted or malformed markdown cannot cause quadratic
backtracking.
## Model Used
- Anthropic Claude Opus 4.6 (`claude-opus-4-6`, extended thinking
enabled, agentic tool use and local command execution)
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
---------
Co-authored-by: Paperclip <noreply@paperclip.ing>
338 lines
12 KiB
TypeScript
338 lines
12 KiB
TypeScript
import { and, desc, eq, isNull, sql } from "drizzle-orm";
|
|
import type { Db } from "@paperclipai/db";
|
|
import {
|
|
activityLog,
|
|
heartbeatRunEvents,
|
|
heartbeatRuns,
|
|
issueComments,
|
|
issues,
|
|
} from "@paperclipai/db";
|
|
import {
|
|
parseSchemaRef,
|
|
validateAgainstJsonSchema,
|
|
type ParsedSchemaRef,
|
|
type SchemaBlock,
|
|
} from "@paperclipai/shared";
|
|
import { getCompanySchema } from "../headless-schemas.js";
|
|
import {
|
|
isLowTrustQuarantined,
|
|
resolveActorSourceTrustForIssue,
|
|
} from "../source-trust.js";
|
|
import {
|
|
isPlainRecord,
|
|
MAX_SCHEMA_FENCE_BODY_CHARS,
|
|
scanFencedSchemaBlocks,
|
|
} from "./native-schema-fences.js";
|
|
|
|
type CandidatePayloadOutcome =
|
|
| { kind: "valid" }
|
|
| { kind: "invalid"; errors: string[] };
|
|
|
|
function evaluateStructuredBlocksForRef(
|
|
blocks: SchemaBlock[] | null | undefined,
|
|
parsedRef: ParsedSchemaRef,
|
|
jsonSchema: Record<string, unknown>,
|
|
): CandidatePayloadOutcome | null {
|
|
if (!Array.isArray(blocks) || blocks.length === 0) return null;
|
|
let firstInvalid: string[] | null = null;
|
|
for (const block of blocks) {
|
|
if (
|
|
!block ||
|
|
block.schema !== parsedRef.name ||
|
|
block.version !== parsedRef.version
|
|
) {
|
|
continue;
|
|
}
|
|
const validation = validateAgainstJsonSchema(jsonSchema, block.data);
|
|
if (validation.valid) return { kind: "valid" };
|
|
firstInvalid ??= validation.errors;
|
|
}
|
|
return firstInvalid ? { kind: "invalid", errors: firstInvalid } : null;
|
|
}
|
|
|
|
function evaluateFencedMarkdownForRef(
|
|
markdown: string | null | undefined,
|
|
parsedRef: ParsedSchemaRef,
|
|
jsonSchema: Record<string, unknown>,
|
|
): CandidatePayloadOutcome | null {
|
|
if (typeof markdown !== "string" || markdown.length === 0) return null;
|
|
const scanned = scanFencedSchemaBlocks(markdown);
|
|
let firstInvalid: string[] | null = null;
|
|
for (const fence of scanned) {
|
|
let fenceRef: ParsedSchemaRef;
|
|
try {
|
|
fenceRef = parseSchemaRef(fence.rawSchemaRef);
|
|
} catch {
|
|
continue;
|
|
}
|
|
if (fenceRef.ref !== parsedRef.ref) continue;
|
|
if (fence.oversized) {
|
|
firstInvalid ??= [
|
|
`fenced block exceeds maximum size of ${MAX_SCHEMA_FENCE_BODY_CHARS} characters`,
|
|
];
|
|
continue;
|
|
}
|
|
let parsedJson: unknown;
|
|
try {
|
|
parsedJson = JSON.parse(fence.rawJson);
|
|
} catch (err) {
|
|
firstInvalid ??= [
|
|
`invalid JSON: ${err instanceof Error ? err.message : "parse error"}`,
|
|
];
|
|
continue;
|
|
}
|
|
if (!isPlainRecord(parsedJson)) {
|
|
firstInvalid ??= ["expected a JSON object payload"];
|
|
continue;
|
|
}
|
|
const validation = validateAgainstJsonSchema(jsonSchema, parsedJson);
|
|
if (validation.valid) return { kind: "valid" };
|
|
firstInvalid ??= validation.errors;
|
|
}
|
|
return firstInvalid ? { kind: "invalid", errors: firstInvalid } : null;
|
|
}
|
|
|
|
export async function assertNativeResultSchemaSatisfied<E extends Error>(
|
|
db: Db,
|
|
binding: {
|
|
companyId: string;
|
|
issueId: string;
|
|
runId: string;
|
|
lockSources?: boolean;
|
|
},
|
|
result: unknown,
|
|
createError: (message: string) => E,
|
|
): Promise<void> {
|
|
const [issueRow] = await db
|
|
.select({
|
|
resultSchemaRef: issues.resultSchemaRef,
|
|
schemaBlocks: issues.schemaBlocks,
|
|
description: issues.description,
|
|
conversationAgentId: issues.conversationAgentId,
|
|
projectId: issues.projectId,
|
|
executionPolicy: issues.executionPolicy,
|
|
sourceTrust: issues.sourceTrust,
|
|
})
|
|
.from(issues)
|
|
.where(and(eq(issues.id, binding.issueId), eq(issues.companyId, binding.companyId)))
|
|
.limit(1);
|
|
|
|
if (!issueRow?.resultSchemaRef || issueRow.conversationAgentId) return;
|
|
|
|
let parsedRef: ParsedSchemaRef;
|
|
try {
|
|
parsedRef = parseSchemaRef(issueRow.resultSchemaRef);
|
|
} catch {
|
|
throw createError(
|
|
`Task specifies an invalid resultSchemaRef '${issueRow.resultSchemaRef}'. Update resultSchemaRef to <name>@<version> before completing.`,
|
|
);
|
|
}
|
|
|
|
let schemaJson: Record<string, unknown>;
|
|
try {
|
|
const schemaView = await getCompanySchema(db, binding.companyId, parsedRef.ref);
|
|
schemaJson = schemaView.jsonSchema;
|
|
} catch {
|
|
throw createError(
|
|
`Task requires result schema '${parsedRef.ref}', which is not registered in this company. Register '${parsedRef.ref}' before completing this task.`,
|
|
);
|
|
}
|
|
|
|
const [runRow] = await db
|
|
.select({
|
|
agentId: heartbeatRuns.agentId,
|
|
contextSnapshot: heartbeatRuns.contextSnapshot,
|
|
})
|
|
.from(heartbeatRuns)
|
|
.where(and(eq(heartbeatRuns.id, binding.runId), eq(heartbeatRuns.companyId, binding.companyId)))
|
|
.limit(1);
|
|
const continuation = isPlainRecord(runRow?.contextSnapshot)
|
|
? runRow.contextSnapshot.executionContinuation
|
|
: null;
|
|
const continuationTrigger = isPlainRecord(continuation) ? continuation.trigger : null;
|
|
const continuationSourceRunId =
|
|
isPlainRecord(continuationTrigger) && typeof continuationTrigger.sourceRunId === "string"
|
|
? continuationTrigger.sourceRunId
|
|
: null;
|
|
const readerSourceTrust = runRow?.agentId
|
|
? await resolveActorSourceTrustForIssue({
|
|
db,
|
|
issue: {
|
|
id: binding.issueId,
|
|
companyId: binding.companyId,
|
|
projectId: issueRow.projectId,
|
|
executionPolicy: issueRow.executionPolicy,
|
|
},
|
|
actor: {
|
|
actorType: "agent",
|
|
actorId: runRow.agentId,
|
|
agentId: runRow.agentId,
|
|
runId: binding.runId,
|
|
},
|
|
})
|
|
: null;
|
|
const hideQuarantined = !isLowTrustQuarantined(readerSourceTrust);
|
|
|
|
const invalidHolder: { errors: string[] | null; untrustedOrPriorSkipped: boolean } = {
|
|
errors: null,
|
|
untrustedOrPriorSkipped: false,
|
|
};
|
|
const recordOutcome = (outcome: CandidatePayloadOutcome | null): boolean => {
|
|
if (!outcome) return false;
|
|
if (outcome.kind === "valid") return true;
|
|
invalidHolder.errors ??= outcome.errors;
|
|
return false;
|
|
};
|
|
|
|
// 1. Run's final completion summary text (when checked before final comment insertion).
|
|
const resultSummary =
|
|
isPlainRecord(result) && typeof result.summary === "string"
|
|
? result.summary
|
|
: null;
|
|
if (recordOutcome(evaluateFencedMarkdownForRef(resultSummary, parsedRef, schemaJson))) {
|
|
return;
|
|
}
|
|
|
|
// 2. Non-deleted comments produced by this run (or bound continuation run / promoted trust).
|
|
const commentQuery = db
|
|
.select({
|
|
body: issueComments.body,
|
|
schemaBlocks: issueComments.schemaBlocks,
|
|
sourceTrust: issueComments.sourceTrust,
|
|
authorAgentId: issueComments.authorAgentId,
|
|
createdByRunId: issueComments.createdByRunId,
|
|
})
|
|
.from(issueComments)
|
|
.where(
|
|
and(
|
|
eq(issueComments.companyId, binding.companyId),
|
|
eq(issueComments.issueId, binding.issueId),
|
|
isNull(issueComments.deletedAt),
|
|
),
|
|
)
|
|
.orderBy(desc(issueComments.createdAt), desc(issueComments.id));
|
|
const comments = await (binding.lockSources
|
|
? commentQuery.for("share", { of: [issueComments], noWait: true })
|
|
: commentQuery);
|
|
|
|
for (const comment of comments) {
|
|
const producedByBoundContinuation =
|
|
Boolean(continuationSourceRunId) &&
|
|
comment.createdByRunId === continuationSourceRunId &&
|
|
Boolean(runRow?.agentId) &&
|
|
comment.authorAgentId === runRow?.agentId;
|
|
const ownedOrPromoted =
|
|
comment.createdByRunId === binding.runId ||
|
|
producedByBoundContinuation ||
|
|
comment.sourceTrust?.disposition === "promoted";
|
|
if ((hideQuarantined && isLowTrustQuarantined(comment.sourceTrust)) || !ownedOrPromoted) {
|
|
if (
|
|
evaluateStructuredBlocksForRef(comment.schemaBlocks, parsedRef, schemaJson)?.kind === "valid" ||
|
|
evaluateFencedMarkdownForRef(comment.body, parsedRef, schemaJson)?.kind === "valid"
|
|
) {
|
|
invalidHolder.untrustedOrPriorSkipped = true;
|
|
}
|
|
continue;
|
|
}
|
|
if (
|
|
recordOutcome(
|
|
evaluateStructuredBlocksForRef(comment.schemaBlocks, parsedRef, schemaJson),
|
|
)
|
|
) {
|
|
return;
|
|
}
|
|
if (recordOutcome(evaluateFencedMarkdownForRef(comment.body, parsedRef, schemaJson))) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 3. Task-level schemaBlocks or description ONLY when explicitly written by this run (or promoted),
|
|
// never from requester-seeded prompt examples or pre-existing task fields.
|
|
const [runFieldEdits] = await db
|
|
.select({
|
|
updatedSchemaBlocks: sql<boolean>`coalesce(bool_or(jsonb_typeof(${activityLog.details}) = 'object' and jsonb_typeof(${activityLog.details}->'changes') = 'object' and (${activityLog.details}->'changes' ? 'schemaBlocks')), false)`,
|
|
updatedDescription: sql<boolean>`coalesce(bool_or(jsonb_typeof(${activityLog.details}) = 'object' and jsonb_typeof(${activityLog.details}->'changes') = 'object' and (${activityLog.details}->'changes' ? 'description')), false)`,
|
|
})
|
|
.from(activityLog)
|
|
.where(
|
|
and(
|
|
eq(activityLog.companyId, binding.companyId),
|
|
eq(activityLog.entityType, "issue"),
|
|
eq(activityLog.entityId, binding.issueId),
|
|
eq(activityLog.action, "issue.updated"),
|
|
eq(activityLog.runId, binding.runId),
|
|
),
|
|
);
|
|
const runUpdatedSchemaBlocks = Boolean(runFieldEdits?.updatedSchemaBlocks);
|
|
const runUpdatedDescription = Boolean(runFieldEdits?.updatedDescription);
|
|
const issuePromoted = issueRow.sourceTrust?.disposition === "promoted";
|
|
if (hideQuarantined && isLowTrustQuarantined(issueRow.sourceTrust)) {
|
|
if (
|
|
evaluateStructuredBlocksForRef(issueRow.schemaBlocks, parsedRef, schemaJson)?.kind === "valid" ||
|
|
evaluateFencedMarkdownForRef(issueRow.description, parsedRef, schemaJson)?.kind === "valid"
|
|
) {
|
|
invalidHolder.untrustedOrPriorSkipped = true;
|
|
}
|
|
} else {
|
|
if (
|
|
(runUpdatedSchemaBlocks || issuePromoted) &&
|
|
recordOutcome(
|
|
evaluateStructuredBlocksForRef(issueRow.schemaBlocks, parsedRef, schemaJson),
|
|
)
|
|
) {
|
|
return;
|
|
}
|
|
if (
|
|
(runUpdatedDescription || issuePromoted) &&
|
|
recordOutcome(
|
|
evaluateFencedMarkdownForRef(issueRow.description, parsedRef, schemaJson),
|
|
)
|
|
) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
// 4. Completed final assistant messages on this run (when evaluated before finalizer persists reply comment).
|
|
const eventQuery = db
|
|
.select({ payload: heartbeatRunEvents.payload })
|
|
.from(heartbeatRunEvents)
|
|
.where(
|
|
and(
|
|
eq(heartbeatRunEvents.companyId, binding.companyId),
|
|
eq(heartbeatRunEvents.runId, binding.runId),
|
|
eq(heartbeatRunEvents.eventType, "item.completed"),
|
|
sql`${heartbeatRunEvents.payload} #>> '{prpEvent,payload,kind}' = 'agentMessage'`,
|
|
),
|
|
)
|
|
.orderBy(desc(heartbeatRunEvents.seq))
|
|
.limit(50);
|
|
const messageEvents = await (binding.lockSources
|
|
? eventQuery.for("share", { of: [heartbeatRunEvents], noWait: true })
|
|
: eventQuery);
|
|
for (const row of messageEvents) {
|
|
const payload = isPlainRecord(row.payload) ? row.payload : null;
|
|
const prpEvent = payload && isPlainRecord(payload.prpEvent) ? payload.prpEvent : null;
|
|
const inner = prpEvent && isPlainRecord(prpEvent.payload) ? prpEvent.payload : null;
|
|
const text = inner && typeof inner.text === "string" ? inner.text : null;
|
|
if (recordOutcome(evaluateFencedMarkdownForRef(text, parsedRef, schemaJson))) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (invalidHolder.errors) {
|
|
throw createError(
|
|
`Task requires a valid structured result matching schema '${parsedRef.ref}', but validation failed: ${invalidHolder.errors.join("; ")}. Post a valid \`\`\`json schema=${parsedRef.ref} block via report_progress or include it in your completion reply before finishing.`,
|
|
);
|
|
}
|
|
|
|
if (invalidHolder.untrustedOrPriorSkipped) {
|
|
throw createError(
|
|
`Task requires a valid structured result matching schema '${parsedRef.ref}' produced by this run (untrusted, quarantined, or prior-run blocks cannot satisfy completion unless promoted). Post a valid \`\`\`json schema=${parsedRef.ref} block via report_progress or include it in your completion reply before finishing.`,
|
|
);
|
|
}
|
|
|
|
throw createError(
|
|
`Task requires a valid structured result matching schema '${parsedRef.ref}', but no matching block was found. Post a valid \`\`\`json schema=${parsedRef.ref} block via report_progress or include it in your completion reply before finishing.`,
|
|
);
|
|
}
|