Skip to content

fix(agent-core): gate background questions on task controls - #3159

Open
pvzheroes125 wants to merge 2 commits into
MoonshotAI:mainfrom
pvzheroes125:feat/ask-user-background-gate
Open

fix(agent-core): gate background questions on task controls#3159
pvzheroes125 wants to merge 2 commits into
MoonshotAI:mainfrom
pvzheroes125:feat/ask-user-background-gate

Conversation

@pvzheroes125

Copy link
Copy Markdown
Contributor

Related Issue

No linked issue. This fixes a host-capability mismatch found during client integration.

Problem

AskUserQuestion always advertised and accepted background questions, even when the active tool policy disabled one or more task controls. That could start a background task the model could not list, inspect, or stop, unlike the existing Bash and Agent behavior.

What changed

  • Reuse the existing TaskList, TaskOutput, and TaskStop capability gate for AskUserQuestion in agent-core v1 and v2.
  • Hide the background parameter and background guidance whenever any task control is unavailable.
  • Reject stale or bypassed background requests before task registration or the question RPC.
  • Preserve foreground answers, dismissal, errors, and the fully enabled background path.
  • Add v1 and v2 coverage, including a v2 policy change between schema discovery and execution.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill.
  • No documentation update is needed because this does not add a public option or protocol.

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89067c4

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

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

commit: 89067c4

@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: 32d6816fc4

ℹ️ 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/tool/index.ts Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 89067c419f

ℹ️ 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".

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