Skip to content

Keep the briefing when a medium goal overruns the typed line - #347

Merged
scgopi merged 2 commits into
mainfrom
fix/345-briefing-before-prompt-file
Sep 13, 2026
Merged

scgopi merged 2 commits into
mainfrom
fix/345-briefing-before-prompt-file

Conversation

@scgopi

@scgopi scgopi commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Fixes #345.

Problem

When the launch command overran the typed-line budget, ZmxSessionLauncher.arguments(forNode:) dropped the briefing first and only moved the prompt to a file if that still didn't fit. A ~600-char goal (e.g. the "Lead a team toward a goal" starter) fit once unbriefed, so it launched with no --append-system-prompt-file and no idea it was in a graph — while multi-KB goals took the file path and kept their briefing.

Fix

The shedding order is now:

Step Prompt Briefing
1 typed inline ✅ kept
2 file + short pointer ✅ kept
3 (only if 2 still overruns) inline if it fits, else pointer ❌ dropped

The three near-identical argv builders collapse into one local shed helper. The unbriefed fallback also keeps the wake-digest pointer, which the old one lost.

Tests

  • New aMediumGoalMovesToAFileBeforeTheBriefingIsDropped sizes its goal from measured baselines, so it always lands in the window that fits unbriefed but overruns briefed. It fails on main with the issue's exact argv (--settings …/claudeCode.json /goal xxx…, no briefing flag) and passes with the fix.
  • Full graphcode suite: 1754 tests passed (xcodebuild exit 0). swiftlint 0 errors, swift format lint --strict clean.

scgopi and others added 2 commits September 13, 2026 10:28
A goal that fit the typed line only without the briefing launched
unbriefed, while longer goals took the prompt-file path and kept it.
Shed in the right order: pointer + briefing first, then drop the
briefing only if that still overruns. The unbriefed fallback also
keeps the wake pointer now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scgopi
scgopi merged commit fbf323a into main Sep 13, 2026
1 check passed
@scgopi
scgopi deleted the fix/345-briefing-before-prompt-file branch September 13, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Medium-length goal (~600 chars) launches with no briefing: overflow ladder sheds the briefing before moving the prompt to a file

1 participant