Skip to content

fix: polish goal lifecycle messaging#555

Merged
kermanx merged 27 commits into
MoonshotAI:mainfrom
chengluyu:fix/goal-nits-2
Jun 9, 2026
Merged

fix: polish goal lifecycle messaging#555
kermanx merged 27 commits into
MoonshotAI:mainfrom
chengluyu:fix/goal-nits-2

Conversation

@chengluyu

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. This PR fixes follow-up issues found while reviewing goal-mode transcripts and outcome messaging.

Problem

Goal-mode status changes and outcome follow-ups were hard to scan:

  • Goal tools could render as raw tool payloads or duplicate lifecycle text.
  • Completed goals did not ask the agent for a final summary.
  • Blocked goals did not show a model-written reason message.
  • Model, provider, and runtime errors blocked goals instead of pausing them.
  • Pause, resume, and cancel transcript markers were too subtle or duplicated status text.
  • The model-facing completion prompt reused the user-facing checkmark headline.

What changed

  • Specialized goal tool rendering for CreateGoal, GetGoal, SetGoalBudget, and UpdateGoal.
  • Continued one follow-up model step after UpdateGoal(complete) or UpdateGoal(blocked) so the agent writes a user-facing completion summary or blocker reason.
  • Paused goals on model, provider, and runtime errors instead of marking them blocked.
  • Polished goal transcript markers by suppressing duplicate blocked markers, making cancel a notice, aligning report colors, and making pause/resume markers more prominent with spacing.
  • Kept the user-visible completion checkmark while using stronger ASCII-only wording in the model-facing outcome prompt.
  • Updated the English and Chinese goal guides for the new lifecycle behavior.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Verification

  • pnpm vitest run packages/agent-core/test/agent/goal-completion.test.ts packages/agent-core/test/harness/goal-session.test.ts apps/kimi-code/test/tui/components/messages/goal-panel.test.ts apps/kimi-code/test/tui/message-replay.test.ts
  • pnpm --filter @moonshot-ai/agent-core run typecheck
  • pnpm --filter @moonshot-ai/kimi-code run typecheck
  • pnpm --filter kimi-code-docs run build
  • git diff --check origin/main...HEAD
  • Read-only diff audit found no internal identifiers or secrets.

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c539c39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@d63de2a
npx https://pkg.pr.new/@moonshot-ai/kimi-code@d63de2a

commit: d63de2a

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b39226e2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core/src/agent/turn/index.ts
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex Please review.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

kermanx added 2 commits June 9, 2026 10:18
# Conflicts:
#	apps/kimi-code/src/tui/controllers/session-event-handler.ts
#	apps/kimi-code/src/tui/controllers/session-replay.ts
#	apps/kimi-code/src/tui/utils/goal-completion.ts
#	apps/kimi-code/test/tui/utils/goal-completion.test.ts
#	packages/agent-core/src/agent/goal/index.ts
#	packages/agent-core/src/agent/records/index.ts
#	packages/agent-core/src/agent/turn/index.ts
#	packages/agent-core/src/rpc/resumed.ts
#	packages/agent-core/src/tools/builtin/goal/update-goal.ts
#	packages/agent-core/test/harness/goal-session.test.ts
#	packages/agent-core/test/tools/goal.test.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3fbc1abd0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/controllers/session-replay.ts
@kermanx

kermanx commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@kermanx

kermanx commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@codex

# Conflicts:
#	packages/agent-core/test/harness/goal-session.test.ts
@kermanx kermanx merged commit 41ebe9f into MoonshotAI:main Jun 9, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d63de2ab39

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core/src/agent/turn/index.ts
Comment thread apps/kimi-code/src/tui/controllers/session-replay.ts
@github-actions github-actions Bot mentioned this pull request Jun 9, 2026
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.

2 participants