Skip to content

feat(project): reject non-ASCII mission titles and record token usage - #3847

Merged
sailist merged 9 commits into
MoonshotAI:mainfrom
tpoisonooo:tower-reject-CJK-title
Sep 20, 2026
Merged

sailist merged 9 commits into
MoonshotAI:mainfrom
tpoisonooo:tower-reject-CJK-title

Conversation

@tpoisonooo

@tpoisonooo tpoisonooo commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related Issue

Resolve #(issue_number)

Problem

  • misson name 有时使用了中文,后续 slugify 过滤后,匹配到了错误历史分支
  • web 卡片显示 agent 名字用 “tower worker worker XXX” 很啰嗦,改成 “M14 worker-shipping” 这种
  • tower 日志里没有记录 token 开销

测试

小卡片改成这样式:

image

What changed

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, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 809f79e

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 Sep 16, 2026 •

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

commit: 809f79e

@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: e0a325b401

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

@tpoisonooo tpoisonooo changed the title WIP feat(project): reject CJK mission titles and record token usage WIP feat(project): reject non-ASCII mission titles and record token usage Sep 17, 2026
@tpoisonooo tpoisonooo changed the title WIP feat(project): reject non-ASCII mission titles and record token usage feat(project): reject non-ASCII mission titles and record token usage Sep 17, 2026
@tpoisonooo

Copy link
Copy Markdown
Collaborator Author

@codex

@sailist
sailist merged commit 65ae3e3 into MoonshotAI:main Sep 20, 2026
15 checks passed
@tpoisonooo
tpoisonooo deleted the tower-reject-CJK-title branch September 20, 2026 11:05
@github-actions github-actions Bot mentioned this pull request Sep 20, 2026
7723qqq added a commit to 7723qqq/kimi-code that referenced this pull request Sep 22, 2026
…3847b)

The audit's tracked-debt list is being paid down; this is the second
item. v2's tower findings/reviews/sends carry the calling agent's
cumulative token total (callerTokens = grandTotal over all four usage
dimensions); the fork had no per-instance usage accumulator at all.

SubagentManager now keeps usage_by_instance, folded at every
turn-completion path (foreground, background spawn_and_run,
persistent), with caller_tokens reporting v2's grandTotal and eviction
/ destroy cleaning the map. The tower writers carry the total into the
records (finding **Tokens** line, review/inbox frontmatter field,
round-tripped by read_inbox).

Recorded divergence: the main agent reports None (v2's -1) — the
session total lives in the host's SQLite turn records, unreachable
from the toolset; subagent callers, who file the tower records in
practice, are fully covered.

The allowlist re-classifies MoonshotAI#3847 to ported (ported=21 / tracked=2 /
not-applicable=7); ROADMAP §6.1 item 33 is struck and §6.2 records
the port.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Oct 5, 2026
Step 9 of the incremental sync to 2.1.1: 24 upstream commits over 321
files. The step brings the TUI mode setting, the jump-to-bottom
indicator, click-to-toggle transcript folds, banner audience targeting
and the workspace-trust hardening.

Upstream's changes in this step, all absorbed:
- add a TUI mode setting for the fullscreen layout (MoonshotAI#4004)
- add a jump-to-bottom indicator and a steady status row (MoonshotAI#3989)
- toggle one transcript fold block with a click (MoonshotAI#3990)
- support audience targeting for startup banners (MoonshotAI#3868)
- harden workspace trust boundaries across git, file tools and the
  local web server (MoonshotAI#3964)
- turn off filesystem watch by default (MoonshotAI#3931)
- add the auto_session_title config option (MoonshotAI#3962)
- prepend a wall-time header to persisted tool results (MoonshotAI#3966)
- report enabled plugins and plugin toggles in telemetry (MoonshotAI#3963)
- include step timing and usage in cold-folded steps (MoonshotAI#3938)
- restore swarm members from persisted lifecycle events (MoonshotAI#3970)
- enforce tower protocol invariants and deny AgentSwarm (MoonshotAI#3976)
- inherit titleKind for default fork titles (MoonshotAI#3974)
- request offline_access in MCP OAuth when the authorization server
  advertises it (MoonshotAI#3979)
- cut CLI startup time and memory in the native binary and config reads
  (MoonshotAI#3975)
- avoid a stack overflow when caching large wire files (MoonshotAI#3957)
- reject non-ASCII mission titles and record token usage (MoonshotAI#3847)
- pick the credential slot and relay from the login region (MoonshotAI#3969)
- add the KIMI_CODE_REPEAT_BREAKER env switch (MoonshotAI#3995)
- update the kimi-webbridge plugin to the 2.0.11 skill (MoonshotAI#3961)
- restructure the PR template and add the write-pr and review-pr skills
  (MoonshotAI#3992)

Fork behaviour that had to survive:
- the TUI controller split: upstream's rewritten activity-pane logic
  (braille thinking/composing spinners, the shared loading-tip kind) was
  ported into the fork's ActivityPaneController, and KimiTUI keeps
  delegating to it
- the i18n layer: the new TUI mode setting, its picker, the restart
  notice and the settings entry all go through `t()` with en/zh entries
- the fork's node-local → host rename: the upstream test files that
  still imported `#/os/backends/node-local/hostFsService` now point at
  `#/os/backends/host/hostFsService`
- the fork's inline media reading: upstream's realpath guard for the
  media tool is covered by a ReadTool-based symlink-escape test
- the fork's removePlugin deletes the plugin root from disk, so the new
  toggle-telemetry fixture keeps its root inside the managed directory
- the Bun toolchain: the retired Node SEA chain stays retired

Verified: typecheck clean across every package and app; full suite
17831 passed / 0 failed / 81 skipped / 1 todo, plus kimi-inspect's own
115 tests; lint 0 errors.
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.

3 participants