fix(workspace-context): restore the no-unrepresented-commit gate after master merge

The master merge rewrote reconcileInstructionContext and dropped this
branch's gate: when no transition survives rendering (tiny budgets
produce notice-only text), emit nothing and commit nothing so the next
pass retries. Restore it, align the inbox one-byte test with that
contract (an unrepresentable change is held back, not committed at 1
byte), and move the nested-retry test's probe assertions to sync time
where reconciliation now runs. Also restore master's markdown spec
casts lost in an earlier merge.
This commit is contained in:
ZiyaZhang
2026-08-06 02:13:43 -07:00
parent a362b41dc9
commit fe2703b641
3 changed files with 15 additions and 4 deletions

View File

@@ -405,6 +405,10 @@ export async function reconcileInstructionContext(
}
if (items.length === 0) return undefined
const rendered = renderInstructionChanges(items, resolved.maxBytes)
// When no transition survived rendering (tiny budgets render notice-only
// text), emit nothing and commit nothing — the uncommitted versions make the
// next pass retry instead of spamming notice-only contexts.
if (rendered.text.length === 0 || rendered.changes.length === 0) return undefined
return {
context: workspaceContextHook(rendered.text, rendered.changes),
versionUpdates: retainedInstructionVersionUpdates(versionUpdates, rendered.changes),