[Feature] Give kimi -p explicit permission modes and a documented structured exit-code contract
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start by tracing runV2Print, resolveNativeSession, forceAuto, and AgentPermissionPolicyService to see how print mode selects permissions and handles blocked tool calls. Then locate the scattered exit paths, including the session occupied code and goal codes in goal-prompt.ts. The issue is done when permission behavior and stable exit codes are implemented and documented, with structured stream-json errors and compatibility for goal codes 0, 3, and 6; the proposed code table and call sites are not included in the payload.
索引モデルが issue の本文から書いたものです。
説明
What feature would you like to see?
Give kimi -p explicit permission controls and a documented, structured exit-code contract.
Permission side:
kimi -p --permission ask|yolo|auto(naming up to the team) so headless runs can choose the policy instead of always being forced intoauto.- In a restricted mode, if a tool call would need approval, fail fast with a structured error instead of silently approving or hanging. Something like
{"type":"error","code":"approval_required","tool":"Bash","reason":"..."}in--output-format stream-json, plus a stable exit code. - Optionally
--deny "<pattern>"/--allow "<pattern>"to pass permission rules for one invocation.
Exit-code contract:
- document every stable exit code in one place, covering at least: success, goal incomplete, blocked, paused, session occupied (currently
4), context overflow, compaction failure, approval required, output truncated, and print wait ceiling reached. - make
--output-format stream-jsonemit one structured error object before exiting for each of those, mirrored by the exit code. - keep the existing goal codes (
0complete,3blocked,6paused) for compatibility and document them next to the new ones.
Additional information
Why this matters:
runV2Printcurrently forcesautofor new and resumed sessions (resolveNativeSession,forceAuto), sokimi -phas no way to run with approvals on. That is convenient for trusted automation but makes it unsafe to run in an untrusted repository, and there is no signal when a run would have needed approval.- In non-interactive hosts,
AgentPermissionPolicyServicealso skips the dangerous-command guard entirely (bootstrap.args.nonInteractive), so print-mode runs have neither prompts nor the guard. The missing guard entries themselves are reported in #5123, and the Bash sensitive-file gap in #5124; those are bugs, but the broader missing control is a feature. - Exit codes are currently scattered:
4for session occupied, goal codes ingoal-prompt.ts, and most other failures exit as a generic error. CI has no stable way to distinguish "provider said no", "context overflow", "the goal did not finish" (#5062), or "the print wait ceiling was reached" (#5122). - A documented contract would let scripts retry only the cases that are retryable and surface the rest.
I checked the tracker for print-mode permission flags and a documented exit-code table and found no existing request. I understand external feature PRs are not accepted; I am only proposing the feature and can provide the exact call sites and a proposed code table if useful.
- 主要言語
- TypeScript
- スター
- 8.3k
- フォーク
- 1.4k
- 平均マージ
- 12時間 6分
- マージ済み PR(30日)
- 596
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MoonshotAI/kimi-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5539 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directories対応中かも @markankamaransheogarat-sys が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MoonshotAI/kimi-code#5256 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MoonshotAI/kimi-code#5062 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MoonshotAI/kimi-code#5057 ·
メンテナーはふだん 1 日以内に返信
MoonshotAI/kimi-code の issue をすべて見る
似ている issue
-
Add Alice&Botオープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
midnightntwrk/midnight-faucet-api#215 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanmiCoder/cc-haha#2034 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mobile prio:low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
digitalfabrik/entitlementcard#3324 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信