Commit graph

479 commits

Author SHA1 Message Date
_Kerman
e2b2b46fc9
refactor(agent-core): make AgentRecords hold the Agent instance directly (#62) 2026-05-26 15:52:26 +08:00
liruifengv
0bcbf167fe
docs(changelog): sync 0.2.0 from apps/kimi-code/CHANGELOG.md (#61) 2026-05-26 15:27:13 +08:00
github-actions[bot]
d496fd40b6
ci: release packages (#42)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-26 15:03:28 +08:00
_Kerman
cf2227e8a5
fix: warn instead of error on newer wire protocol version (#49)
* fix: warn instead of error on newer wire protocol version

* fix

* fix test
2026-05-26 14:56:32 +08:00
liruifengv
064343a6e5
fix: correct X-Msh-Platform header value to kimi_code_cli (#52) 2026-05-26 14:39:19 +08:00
7Sageer
c473823a4b
feat(kimi-code): use positional args and bare keywords for /connect (#50)
Replace the --flag style (/connect --url=..., /connect --refresh)
with positional arguments and bare keywords:

- /connect https://example.com/catalog.json
- /connect refresh
- /connect (no args, default behavior)

This aligns the slash-command UX with peer CLI tools (claude-code,
pi, opencode) where slash commands use bare words rather than
CLI-style flags.

Closes #30 follow-up
2026-05-26 14:24:42 +08:00
7Sageer
cf5270ce6a
docs: document /connect and trim its changeset wording (#48)
* docs: document /connect command and model catalog

Add a /connect row to the slash-commands reference (English and Chinese)
and a new "/connect and the model catalog" section in providers.md that
covers the bundled catalog, --refresh, --url, and the relationship with
hand-written config.toml entries.

* chore(changeset): trim /connect changesets to user-facing wording

Drop internal phrasing (pruned snapshot, "not gated by models.dev",
fallback mechanics, and the Anthropic catalog base URL path fix that
landed alongside the initial /connect implementation) so the release
notes describe behavior users can observe, not implementation details.

* docs(zh): translate "catalog/flag/endpoint" in /connect section

Rework the Chinese wording for the /connect docs: render "model catalog"
as "模型目录" (with the English term in parentheses on first use), drop
the leftover English "flag"/"endpoint" usage, and smooth out the
translationese in the surrounding sentences.

Update the cross-link anchor in slash-commands.md to match the new
Chinese heading.

* docs(en): tighten /connect wording

Fix the subject/verb mismatch in the /connect step description (the
sentence switched subjects mid-list), replace "endpoint" with the more
accurate "URL" since the catalog source is a static JSON file, and
clarify that /connect is limited to the provider types in the table
above rather than to whatever the catalog happens to cover.

* chore(changeset): keep connect-model-catalog changelog to one line

Defer --refresh, --url, and metadata details to the new docs section
(`/connect` and the model catalog in configuration/providers.md). The
changelog now just announces the command exists.
2026-05-26 14:19:44 +08:00
Haozhe
07ed2cf9d4
fix(cli): fix first launch telemetry timing and extract telemetry init (#47)
* fix(cli): fix first launch telemetry timing and extract telemetry init (7 files)

- extract telemetry initialization into cli/telemetry.ts\n- ensure deviceId is created before harness construction for correct first_launch tracking\n- emit session resume hint as meta message in stream-json output format
2026-05-26 13:57:22 +08:00
7Sageer
a200a297ac
feat(kimi-code): add /connect command with bundled model catalog (#30)
* feat: add /connect command with models.dev catalog support

Add a /connect slash command that configures a provider and model
from a models.dev-style catalog. Users no longer need to hand-write
model metadata (context window, output limit, capabilities).

Architecture (3 layers):
- kosong: pure data layer — Catalog schema, inferWireType,
  catalogModelToCapability
- node-sdk: IO + config write — fetchCatalog, applyCatalogProvider,
  catalogModelToAlias
- app: TUI flow — /connect command, provider/model selection,
  credential input, config persistence

UI improvements in this PR:
- ChoicePickerComponent: add searchable (fuzzy filter + search bar)
- ModelSelectorComponent: add searchable (same)
- Extract reusable paging.ts for list pagination

Changesets included for kosong, kimi-code-sdk, and kimi-code.

* feat: bundle pruned models.dev catalog for offline /connect

When the network is unavailable, /connect now falls back to a built-in
snapshot of the models.dev catalog.

- `scripts/update-catalog.mjs`: fetches models.dev/api.json, strips
  unnecessary fields, and writes `src/built-in-catalog.ts` with the
  JSON string as a TS constant.
- `loadBuiltInCatalog(text?)` in node-sdk: parses the JSON string safely;
  returns undefined on any failure.
- `handleConnectCommand`: on fetch failure, shows an informative offline
  message and tries the built-in snapshot.
- The snapshot file is a placeholder (`undefined`) in source control;
  `update-catalog.mjs` populates it before release builds so the actual
  catalog is inlined into the bundle by rolldown.

* refactor(tui): share search and pagination across list pickers

ChoicePicker and ModelSelector each carried their own copy of the cursor +
fuzzy-search + pagination state machine. Extract it into a reusable
SearchableList so both pickers share one implementation; behavior is unchanged.

* fix(tui): filter unsupported catalog providers

* docs(tui): clarify /connect stale-alias cleanup depends on removeProvider

* fix(kimi-code): inject built-in catalog at release time

* feat(tui): hint at /login and /connect when /model has no models

Replace the bare "No models configured." error with a notice that
points users to /login for Kimi and /connect for other providers.

* fix(tui): tighten /connect error reporting for edge cases

Two silent-failure cases in /connect could leave users without any
feedback to act on:

- Reject `--url` when its value is missing (e.g. `/connect --url` or
  `/connect --url=`). Previously the argument parser silently fell
  back to the default catalog, so a malformed flag still appeared to
  succeed but with the wrong source.
- Show an explicit error when the resolved catalog yields no providers
  with supported wire types. Previously the picker resolved with no
  selection and the command returned without any UI feedback.

* chore(tui): restore slash invalid intent type

* fix(tui): support /logout for /connect-configured providers

After /connect writes a non-managed provider (e.g. openai), /logout
fell through to "Nothing to logout." because the handler only matched
the managed default and isOpenPlatformId branches, leaving users no
in-app way to drop the API key and model aliases they just configured.

Collapse the OpenPlatform branch into a generic "provider is present
in config" check so any non-managed provider in config — OpenPlatform
OAuth targets and /connect catalog providers — goes through the same
removeProvider path.

* fix(tui): reject --url values that are not http(s) URLs

`resolveConnectCatalogRequest` previously matched any non-space token
after `--url` as the URL, so `/connect --url --refresh` parsed
`--refresh` as the value and bypassed the missing-value error path.
Bare non-URL tokens (`/connect --url not-a-url`) and non-http(s)
schemes were also silently accepted.

Constrain the captured value to `https?://...` so flag-like and
non-URL tokens fall through to the existing `URL_FLAG_PRESENT_RE`
check and surface a clear error.

* ci(native): scope built-in catalog generation to signed macOS jobs

The catalog-generation step ran whenever `inputs.sign-macos` was true,
including Linux and Windows targets that take the local-profile build
path and never consume the generated catalog. A transient models.dev
outage would therefore fail unrelated artifact builds.

Match the condition to the macOS signed release-profile build that
actually consumes the bundled catalog.

* fix(ci): embed built-in catalog in non-macOS native artifacts

The earlier narrowing to `runner.os == 'macOS' && inputs.sign-macos`
relied on a misread of build.mjs: its `profile === 'release'` guard
only auto-fetches the catalog as a dev fallback. Whether the binary
actually embeds the catalog is decided by tsdown's define at bundle
time, which reads KIMI_CODE_BUILT_IN_CATALOG_FILE regardless of
profile.

Linux and Windows release artifacts therefore lost their bundled
catalog and silently regressed offline /connect on those targets.
Restore generation for all OS jobs when sign-macos is true.

* chore(tui): mention /connect in welcome panel hints

Align the welcome panel with the /model picker so the empty-state copy
points users to both /login and /connect.
2026-05-26 12:34:49 +08:00
Fengzc
e9e4a48633
fix(cli): clarify prompt mode login guidance (#38) 2026-05-26 12:13:28 +08:00
KOMATA
ab4bd09082
fix(oauth): report macOS product version in device model (#33)
Co-authored-by: liruifengv <liruifeng1024@gmail.com>
2026-05-26 12:12:17 +08:00
_Kerman
c4dd1c7ff2
feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
Kai
475ebadc20
fix: copy user skills and clean up OAuth UX (#31)
* feat(migration-legacy): migrate user skills from kimi-cli

The first-launch migration previously left ~/.kimi/skills/ behind: the
new scanner only reads ~/.kimi-code/skills/ and ~/.agents/skills/, so any
custom skills authored against kimi-cli silently disappeared after the
upgrade. Adds a skills step that copies top-level entries from
~/.kimi/skills/ into ~/.kimi-code/skills/ with skip-existing semantics,
wires it into the existing run-migration pipeline and result screen, and
surfaces the count alongside config/mcp/REPL-history.

* refactor(migration): hide OAuth from migration UX

OAuth credentials are deliberately never migrated (refresh tokens
rotate server-side, so two installs sharing one token would fight over
who gets refreshed). The previous UX framed this as a limitation: the
result screen carried a yellow ⚠ "kimi-cli login not migrated — run
/login" line, and the pre-migration summary listed "kimi-cli login
(needs /login)" alongside real migratable data classes, making users
think a login was about to be transferred and only the last step had
failed.

Drops both surfaces and short-circuits the pre-migration screen when
the only legacy data is `credentials/*.json`. kimi-code's own /login
flow handles re-auth on first use, so a dedicated migration notice is
redundant. The `report.notices.oauthLoginsRequiringRelogin` JSON field
is left intact for debugging.

* chore: changeset for skills migration and OAuth UX cleanup
2026-05-25 21:16:36 +08:00
qer
0f74525695
docs: enhance PR guidelines and template (#28)
* docs: enhance PR guidelines and template

* docs: refine contribution guidelines and issue templates

Clarify when to open an issue first, what can go straight to a PR,
and align CONTRIBUTING with the PR template without duplicating checklists.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: update doc

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 20:04:23 +08:00
liruifengv
df7a9cab60
fix: prevent streaming tool argument CPU spikes (#29)
* fix: prevent streaming tool argument CPU spikes

* test: update Anthropic streaming mock
2026-05-25 19:49:11 +08:00
liruifengv
7858821f2f
fix: persist TUI model selection defaults (#24)
* Persist runtime model and default thinking

* fix: persist model defaults from TUI

* refactor: centralize default thinking resolution

* fix: wait for background shutdown notifications

* Revert "fix: wait for background shutdown notifications"

This reverts commit cf98059b8d.

* test: remove SDK default thinking case

* fix: respect thinking mode off defaults

* fix: normalize runtime thinking requests
2026-05-25 19:32:08 +08:00
qer
bfbd522a71
fix: widen Kimi completion budget (#17) 2026-05-25 18:41:59 +08:00
_Kerman
2004aedfe1
feat(agent-core): add agent record migrations (#22)
* feat(agent-core): add agent record migrations

* test(agent-core): include wire metadata in subagent fixtures

* docs(agent-core): document wire version format
2026-05-25 17:10:39 +08:00
_Kerman
0da60730b9
refactor: isolate agent record persistence (#14) 2026-05-25 16:28:33 +08:00
liruifengv
a964bd2430
fix(kimi-code): warn about tmux key configuration (#18) 2026-05-25 16:22:03 +08:00
liruifengv
67f8a2d606
ci: Update manual-native-bundle.yml (#19) 2026-05-25 16:19:29 +08:00
Haozhe
67d3cb8ad0
fix(shell): fix bash timeout hang when daemon inherits stdio pipes (#10)
- destroy stdout/stderr on abort to release stdio pipes held by detached daemons\n- use `exit` instead of `close` event to resolve exit promise

Co-authored-by: haozhe.yang <yanghaozhe@moonshot.ai>
2026-05-25 16:12:59 +08:00
Haozhe
ee7486cb06
fix(agent-core): tier anti-repeat reminders at streak counts 3, 5, and 8 (#15)
Replace the single threshold of 7 with tiered reminders triggered at streak counts 3, 5, and 8.\nThe first reminder is a generic nudge, while the second and third include\nthe tool name, repeat count, and arguments for stronger guidance.

Co-authored-by: haozhe.yang <yanghaozhe@moonshot.ai>
Co-authored-by: Kai <me@kaiyi.cool>
2026-05-25 16:09:41 +08:00
liruifengv
35726d7a41
fix: hide empty current session from sessions list (#13)
* fix: hide empty current session from sessions list

* chore: add changeset for session picker fix

* fix: use TUI content state for session picker filtering

---------

Co-authored-by: qer <wbxl2000@outlook.com>
2026-05-25 14:50:29 +08:00
qer
89ea8959eb
fix: retry empty compaction summaries (#12)
Co-authored-by: liruifengv <liruifeng1024@gmail.com>
2026-05-25 14:44:22 +08:00
liruifengv
15b018fc84
fix: Surface API-provided error messages for OAuth and managed API failures (#11) 2026-05-25 14:10:32 +08:00
liruifengv
e503e6963a
feat: add Ctrl-J newline shortcut in TUI prompt (#9) 2026-05-25 12:30:25 +08:00
Yichen Yan
154e5a732b
Fix typo in zh readme (#1) 2026-05-22 18:54:14 +08:00
Kaiyi
842e699a64 Kimi For Coding 2026-05-22 15:54:50 +08:00