Skip to content

Commit 481b28b

Browse files
authored
fix(agent-core-v2): correct goal lifecycle error guidance (#1743)
* fix(agent-core-v2): correct goal lifecycle error guidance * refactor(agent-core-v2): remove unused goal service API
1 parent 8a3f1ff commit 481b28b

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@moonshot-ai/kimi-code": patch
3+
---
4+
5+
Correct the guidance text shown when a goal cannot be paused or resumed.

packages/agent-core-v2/src/agent/goal/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const GoalErrors = {
4444
title: 'Invalid goal status transition',
4545
retryable: false,
4646
public: true,
47-
action: 'Use a status allowed for this actor (complete, blocked, or impossible).',
47+
action: 'Only an active goal can be paused; resume a blocked goal with `/goal resume`.',
4848
},
4949
'goal.metadata_reserved': {
5050
title: 'Goal metadata is reserved',
@@ -56,7 +56,7 @@ export const GoalErrors = {
5656
title: 'Goal is not resumable',
5757
retryable: false,
5858
public: true,
59-
action: 'Only paused goals can be resumed.',
59+
action: 'Only paused or blocked goals can be resumed.',
6060
},
6161
'goal.unsupported_agent': {
6262
title: 'Goals are unavailable for subagents',

packages/agent-core-v2/src/agent/goal/goalService.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,6 @@ export class AgentGoalService extends Disposable implements IAgentGoalService {
326326
return { goal: state === null ? null : this.toSnapshot(state) };
327327
}
328328

329-
getActiveGoal(): GoalSnapshot | null {
330-
this.assertSupportedAgent();
331-
const state = this.goalState;
332-
if (state === null || state.status !== 'active') return null;
333-
return this.toSnapshot(state);
334-
}
335-
336329
isGoalToolTarget(turnId: number, goalId: string): boolean {
337330
this.assertSupportedAgent();
338331
return this.goalTurnTargets.get(turnId) === goalId;

packages/agent-core-v2/test/agent/goal/goal.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ describe('goal error catalog metadata', () => {
15051505
title: 'Invalid goal status transition',
15061506
retryable: false,
15071507
public: true,
1508-
action: 'Use a status allowed for this actor (complete, blocked, or impossible).',
1508+
action: 'Only an active goal can be paused; resume a blocked goal with `/goal resume`.',
15091509
});
15101510
expect(errorInfo('goal.metadata_reserved')).toEqual({
15111511
title: 'Goal metadata is reserved',
@@ -1517,7 +1517,7 @@ describe('goal error catalog metadata', () => {
15171517
title: 'Goal is not resumable',
15181518
retryable: false,
15191519
public: true,
1520-
action: 'Only paused goals can be resumed.',
1520+
action: 'Only paused or blocked goals can be resumed.',
15211521
});
15221522
expect(errorInfo('goal.unsupported_agent')).toEqual({
15231523
title: 'Goals are unavailable for subagents',

0 commit comments

Comments
 (0)