Skip to content

Commit d657b93

Browse files
committed
fix: pause goals during context compaction
Pause active goals without aborting automatic compaction, then resume only after compaction succeeds. Cover cancellation, restart, budget, replay, and duplicate-continuation paths in both engines. Task: goal-pause-compaction
1 parent f80ed9c commit d657b93

14 files changed

Lines changed: 1130 additions & 20 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Pause active goals during automatic context compaction and resume them after compaction succeeds.

apps/pythinker-code/test/tui/components/messages/goal-markers.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ describe('buildGoalMarker', () => {
4949
expect(strip(marker!.render(80))).toBe('\n● Goal paused after runtime error: socket hang up');
5050
});
5151

52+
it('shows that a compaction-paused goal will resume', () => {
53+
const marker = buildGoalMarker(
54+
{
55+
kind: 'lifecycle',
56+
status: 'paused',
57+
reason:
58+
'Paused because context compaction is in progress; it will resume after compaction completes',
59+
} as GoalChange,
60+
false,
61+
'runtime',
62+
);
63+
64+
expect(strip(marker!.render(100))).toBe(
65+
'\n● Goal paused because context compaction is in progress; it will resume after compaction completes',
66+
);
67+
});
68+
5269
it('keeps long provider pause markers within the terminal width', () => {
5370
const reason =
5471
'Paused after provider API error: 400 {"error":{"message":"request id: 456043b9-6491-11f1-9425-2221bb1af97c, \\"thinking.enabled\\" is not supported for this model. Use \\"thinking.adaptive\\" and \\"output_config.effort\\" to control thinking behavior.","type":"invalid_request_error"}}';

0 commit comments

Comments
 (0)