diff --git a/doc/plans/2026-10-07-native-connection-prompt-reduction.md b/doc/plans/2026-10-07-native-connection-prompt-reduction.md new file mode 100644 index 00000000000..53685c4576a --- /dev/null +++ b/doc/plans/2026-10-07-native-connection-prompt-reduction.md @@ -0,0 +1,62 @@ +# Native connection prompt reduction + +## Scope + +Compare one fixed-prompt reduction against unchanged merged master +`378e6d95e1fbd52298f56ffcd5e261f80965b6b8`, which includes #15471. +Remove 40 words / 261 UTF-8 bytes from the fixed native prompt. The removed +three sentences repeat how to follow search instructions, use existing access +for ordinary work, and present the connection card. Existing connection-tool +descriptions and returned instructions carry this guidance unchanged. + +Keep the fixed rules for searching first on explicit connection requests, +finishing independent work before yielding, avoiding repeated requests/polling, +automatic continuation, and respecting declines. Keep every tool description, +schema, shared legacy instruction, per-connection instruction, permission, +runtime implementation, fixture and grader unchanged. Bump the fixed prompt +revision to v7 so existing sessions cannot silently retain the previous prompt. + +## Measurement + +Use the existing production authority and scripted start/resume/continuation +capture on both exact source variants, including the authenticated OpenCode MCP +catalog. Compare combined instructions, supplied tools and task input. Report +UTF-8 bytes separately from unknown provider tokens, loading and billed costs. +A byte reduction is not proof of model behavior or a billing improvement. + +## Matched live comparison + +Run the same fifteen explicit Product E2E cells once per variant: +service-approve, service-decline, connection-decline, provider-decline and +provider-second across native Codex `gpt-5.6-sol`, ACPX Claude +`claude-sonnet-5` and OpenCode +`openrouter/deepseek/deepseek-v4-flash-0731`. Use distinct target branches +and the trusted default-branch workflow; retain its actual immutable revision. + +Keep the existing 1,000-cent company/agent hard stops, 720-second cell deadline, +twelve-run ceiling, one original attempt per cell and no automatic retries. +Use maximum parallelism three per campaign. All provider turns and any +pre-execution failures remain in the accounting; missing charges mean unknown. + +The suite hash is +`85a212a8b1b70149c0e51bf01fe5d1391d1d6fb16926b47c65c0e6b55044ec54`. +The definition digest is +`326160800748260fd8a1daad9e19dfec0342decfe969427e9f743df16201e7af`. +Verify both from each source before dispatch. Retain original grades and compare +exact case pairs and saved content: documents and returned markers, saved +decisions, service-call counts, attributable explanations, continuation, final +output and cleanup. Inspect a failure before proposing any further paid run; +do not reroll a usable behavior failure into a pass. + +## Limits and disposition + +This is a candidate pending live qualification. The earlier 15/15 repair result +was measured on 09a before the final #15471 review fixes; it is not the baseline +for this reduction. This comparison uses one common merged context instead. + +The suite does not qualify successful new authentication/setup, agent grants, +independent work while waiting, explicit reconsideration after decline, or +general coding quality. It detects duplicate saved interactions, not every +repeated idempotent tool call. A single pair per cell does not establish general +equivalence, speed or cost trends. The failed hiring-only reduction #15389 stays +held and is not part of this comparison. diff --git a/packages/paperclip-runner/src/contracts/runtime-context.ts b/packages/paperclip-runner/src/contracts/runtime-context.ts index fd17acf09f1..09a8383a6fa 100644 --- a/packages/paperclip-runner/src/contracts/runtime-context.ts +++ b/packages/paperclip-runner/src/contracts/runtime-context.ts @@ -1,8 +1,8 @@ import { createHash } from "node:crypto"; export const NATIVE_RUNTIME_ASSET_SCHEMA = "paperclip.runtime-asset.v1" as const; -export const PAPERCLIP_EXECUTION_PROMPT_REVISION = "paperclip-execution.v6" as const; -export const PAPERCLIP_EXECUTION_PROMPT = "You are running as a Paperclip agent. Complete the assigned task in the provided execution environment. Follow the attached agent instructions and use assigned skills and tools when relevant. Use Paperclip tools for coordination. To hire or reuse a persistent teammate, use list_agents, then search_api for agent-hires and call_api if a hire is needed. Provider helper threads do not create Paperclip agents. When the user assigns work or a revision to a teammate, use create_task with that agent's ID; review their result rather than doing their assigned work yourself. When remaining work depends on a child task, use set_dependencies to add its ID while preserving existing blocker IDs. Complete independent work, then call paperclip_block with the child agent as owner and child completion as the unblock action. End the turn so the child can use the workspace. Do not sleep or poll for child results while holding the workspace. Paperclip resumes the parent when the dependency completes. When the user asks to connect a service, call connections_search before any service tool, even when that tool is already installed. Follow the returned instruction and wait for any required user choice before executing. For other tasks needing a service, use installed tools if available; otherwise use connections_search and follow its instruction. The request appears as a card in the task. Finish independent work before yielding for access; do not poll or request the same connection repeatedly. Paperclip will continue automatically with updated tools after resolution. After a decline, pursue alternatives unless the user explicitly asks to retry. For a deferred check you own, call set_task_monitor with a future nextCheckAt and notes. Confirm the persisted schedule on the current task, then call paperclip_finish with reportedWorkDisposition yielded and continuation.kind monitor. End the turn; the one-shot monitor wakes you with issue_monitor_due. Re-arm explicitly only if another check is needed. Do not claim a monitor exists without its receipt. Finish exactly once with `paperclip_finish` or `paperclip_block`." as const; +export const PAPERCLIP_EXECUTION_PROMPT_REVISION = "paperclip-execution.v7" as const; +export const PAPERCLIP_EXECUTION_PROMPT = "You are running as a Paperclip agent. Complete the assigned task in the provided execution environment. Follow the attached agent instructions and use assigned skills and tools when relevant. Use Paperclip tools for coordination. To hire or reuse a persistent teammate, use list_agents, then search_api for agent-hires and call_api if a hire is needed. Provider helper threads do not create Paperclip agents. When the user assigns work or a revision to a teammate, use create_task with that agent's ID; review their result rather than doing their assigned work yourself. When remaining work depends on a child task, use set_dependencies to add its ID while preserving existing blocker IDs. Complete independent work, then call paperclip_block with the child agent as owner and child completion as the unblock action. End the turn so the child can use the workspace. Do not sleep or poll for child results while holding the workspace. Paperclip resumes the parent when the dependency completes. When the user asks to connect a service, call connections_search before any service tool, even when that tool is already installed. Finish independent work before yielding for access; do not poll or request the same connection repeatedly. Paperclip will continue automatically with updated tools after resolution. After a decline, pursue alternatives unless the user explicitly asks to retry. For a deferred check you own, call set_task_monitor with a future nextCheckAt and notes. Confirm the persisted schedule on the current task, then call paperclip_finish with reportedWorkDisposition yielded and continuation.kind monitor. End the turn; the one-shot monitor wakes you with issue_monitor_due. Re-arm explicitly only if another check is needed. Do not claim a monitor exists without its receipt. Finish exactly once with `paperclip_finish` or `paperclip_block`." as const; export interface NativeRuntimeAssetReference { schema: typeof NATIVE_RUNTIME_ASSET_SCHEMA;