mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
fix: skip --append-system-prompt-file on resumed claude sessions
On resumed sessions the agent instructions are already present in the session cache. Unconditionally passing --append-system-prompt-file re-injects 5-10K redundant tokens per heartbeat and may be rejected by the Claude CLI when combined with --resume. Guard the flag behind `!resumeSessionId` so it is only appended on fresh session starts. Fixes: #2848
This commit is contained in:
parent
667d5a7384
commit
3cfbc350a0
2 changed files with 95 additions and 1 deletions
|
|
@ -448,7 +448,10 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
|
|||
}
|
||||
if (effort) args.push("--effort", effort);
|
||||
if (maxTurns > 0) args.push("--max-turns", String(maxTurns));
|
||||
if (effectiveInstructionsFilePath) {
|
||||
// On resumed sessions the instructions are already in the session cache;
|
||||
// re-injecting them via --append-system-prompt-file wastes 5-10K tokens
|
||||
// per heartbeat and the Claude CLI may reject the combination outright.
|
||||
if (effectiveInstructionsFilePath && !resumeSessionId) {
|
||||
args.push("--append-system-prompt-file", effectiveInstructionsFilePath);
|
||||
}
|
||||
args.push("--add-dir", skillsDir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue