Skip to content

fix: count goal creation turn#1477

Merged
chengluyu merged 1 commit into
mainfrom
fix/goal-create-turn-count
Jul 7, 2026
Merged

fix: count goal creation turn#1477
chengluyu merged 1 commit into
mainfrom
fix/goal-create-turn-count

Conversation

@chengluyu

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. This PR fixes a focused goal-mode accounting bug.

Problem

When the model created a goal during an ordinary turn, that turn did not count toward the goal's turn usage. The next continuation turn became turn 1, so completion summaries and turn budgets undercounted the work already done to start the goal.

What changed

  • Count the ordinary turn that creates or resumes an active goal before the continuation driver runs.
  • Added a goal-session regression test that completes a model-created goal and checks the final turn count.
  • Added a patch changeset for the CLI release.

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.

@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1b0c11

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

This PR includes changesets to release 1 package
Name Type
@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

@chengluyu chengluyu marked this pull request as ready for review July 7, 2026 12:15
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

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

commit: a1b0c11

@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: 2b9ab4b956

ℹ️ 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 Outdated
@chengluyu chengluyu force-pushed the fix/goal-create-turn-count branch from 2b9ab4b to a1b0c11 Compare July 7, 2026 13:45
@chengluyu chengluyu merged commit 150206a into main Jul 7, 2026
10 checks passed
@chengluyu chengluyu deleted the fix/goal-create-turn-count branch July 7, 2026 13:51
@github-actions github-actions Bot mentioned this pull request Jul 7, 2026
sailist pushed a commit that referenced this pull request Jul 8, 2026
sailist pushed a commit that referenced this pull request Jul 8, 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.

1 participant