Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bcb1d96
fix(tui): erase viewport redraws without saving stale history (#309)
hetaoBackend Sep 22, 2026
00a7e7d
feat(tui): add selectable themes and custom theme files (#311)
hetaoBackend Sep 22, 2026
a346908
chore: release MiniMax Code 0.5.2 (#313)
hetaoBackend Sep 22, 2026
44b13d3
perf(edit): bound the post-edit diff and unified patch (#284)
TrentChou Sep 22, 2026
2ede8e4
docs: document BYOK session-affinity compat key (#323)
hetaoBackend Sep 23, 2026
b47eb90
fix(tui): preserve transcript position while reading history (#324)
hetaoBackend Sep 23, 2026
25518db
fix(tui): restore early-aborted prompt to composer (#325)
hetaoBackend Sep 23, 2026
b7456eb
docs: define pull request label usage (#326)
hetaoBackend Sep 23, 2026
bb39720
fix(tui): rebuild chat after closing full viewport interactions (#328)
hetaoBackend Sep 23, 2026
7f2fe52
fix(tui): clear previous run duration on new turn (#327)
hetaoBackend Sep 23, 2026
cf66c7f
fix(tui): dismiss interrupted duration on submit frame (#329)
hetaoBackend Sep 23, 2026
944e874
fix(tui): switch theme appearance with arrow keys (#330)
hetaoBackend Sep 23, 2026
b2f146a
fix(tui): keep interrupted footer hidden during edit resubmission (#332)
hetaoBackend Sep 23, 2026
ffbfff6
fix(tui): restore chat viewport after autocomplete shrinks (#331)
hetaoBackend Sep 23, 2026
76262af
fix(tui): restore chat after transient layout shrink (#333)
hetaoBackend Sep 23, 2026
47d1424
fix(skills): discover linked workspace skill directories (#337)
hetaoBackend Sep 23, 2026
782f64d
fix(tui): reset rewound todos and preserve local commands during edit…
hetaoBackend Sep 23, 2026
67afb61
feat(tui): select plugins with durable identity mentions (#334)
hetaoBackend Sep 23, 2026
a914a30
chore(tui): restore source ESLint rules and verification gate (#341)
hetaoBackend Sep 23, 2026
5bba9c7
Merge remote-tracking branch 'origin/main' into merge/upstream-a914a30
hermes-agent Sep 23, 2026
823d024
chore: reconcile generated source inventory after upstream merge
hermes-agent Sep 23, 2026
2c4c584
fix: adapt upstream theme/launcher/plugin changes to fork Kcode identity
hermes-agent Sep 23, 2026
0164245
fix: satisfy the lint:tui gate on the fork (upstream #341 follow-up)
hermes-agent Sep 23, 2026
1451ca2
fix: adapt upstream theme tests and TUI copy assertions to the Kcode …
hermes-agent Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/testing-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ suites are outside this distribution's verification.
| Sandbox on macOS | `pnpm test:sandbox` |
| Source-sync, workflow and release tools | `pnpm test:release-tools` |
| npm release archive installation | `MCODE_RELEASE_TAG=vX.Y.Z MCODE_RELEASE_ARCHIVE=/path/to/package.tar.gz pnpm verify --profile package` |
| TUI source and test lint | `pnpm lint:tui` |
| Types and standalone build boundary | `pnpm typecheck`, `pnpm build`, `pnpm check:standalone` |
| Published files and generated paths | `pnpm check:source`, `pnpm check:tsconfig` |

Expand Down
129 changes: 129 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// TUI rules adapted from the source repository, without browser/React rules.
// Keep Pi engine style exceptions aligned with the audited fork.
module.exports = {
root: true,
env: {
es2022: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
},
plugins: ["@typescript-eslint", "import", "prettier"],
extends: [
"airbnb-base",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: [
"dist/",
"node_modules/",
"third_party/",
"packages/tui/test/pi-084-upstream/",
],
rules: {
"prettier/prettier": [
"warn",
{
trailingComma: "all",
tabWidth: 2,
semi: true,
singleQuote: true,
useTabs: false,
bracketSpacing: true,
arrowParens: "always",
jsxSingleQuote: false,
printWidth: 100,
endOfLine: "auto",
embeddedLanguageFormatting: "auto",
proseWrap: "always",
},
],
"import/extensions": "off",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/order": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],
"consistent-return": "off",
"no-restricted-syntax": "off",
"class-methods-use-this": "off",
"no-underscore-dangle": "off",
"no-continue": "off",
"no-await-in-loop": "off",
"no-void": "off",
"no-nested-ternary": "off",
"no-plusplus": "off",
"no-bitwise": "off",
"no-cond-assign": "off",
"no-promise-executor-return": "off",
"no-restricted-globals": "off",
"no-duplicate-imports": "off",
"no-multi-assign": "off",
"default-case": "off",
"max-classes-per-file": "off",
radix: "off",
"no-param-reassign": [
"error",
{
props: false,
},
],
"no-control-regex": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-loop-func": "warn",
camelcase: "off",
"lines-between-class-members": "off",
"no-unused-expressions": "off",
"dot-notation": "off",
"no-useless-constructor": "off",
"no-empty-function": "off",
"no-return-await": "off",
"no-throw-literal": "off",
"default-param-last": "off",
"no-loop-func": "off",
eqeqeq: "error",
"no-var": "error",
"prefer-const": "error",
"no-console": [
"warn",
{
allow: ["warn", "error"],
},
],
"no-alert": "warn",
"no-empty": "warn",
"no-unsafe-finally": "warn",
"no-constant-condition": "warn",
"prefer-destructuring": "off",
},
overrides: [
{
files: ["packages/tui/src/tui/engine/**/*.ts"],
excludedFiles: ["packages/tui/src/tui/engine/public.ts"],
rules: {
"@typescript-eslint/no-shadow": "off",
"no-else-return": "off",
"no-lonely-if": "off",
"no-param-reassign": "off",
"one-var": "off",
"prefer-regex-literals": "off",
},
},
],
};
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Describe the user-visible problem and resulting behavior. Link a public issue when applicable.

- PR labels: change type (`bug`, `enhancement`, `documentation` or `dependencies`) and affected product (`cli`, `tui` together with `cli`, or `desktop`) where applicable; see the [label guide](https://github.com/MiniMax-AI/minimax-code/blob/main/docs/maintainers.md#pull-request-labels).

## Validation

- Checks run and results (include the revision/profile where relevant):
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Thanks for your interest in contributing. For now, we only accept code and docum

Repository collaborators should submit pull requests from feature branches; do not push directly to the default branch. Describe user-visible changes, checks you ran, live-service or platform validation you did not run, and documentation impact. Preserve real author identities and existing copyright notices.

Apply the relevant change-type and product labels using the [pull request label guide](docs/maintainers.md#pull-request-labels). Add `perf:full` separately when the [performance rules](#performance-checks) require the full suite.

## Maintainers and review

See [Maintainers](docs/maintainers.md) for review ownership, independent approval, security/release routing and the public-to-internal contribution flow. The [PR template](.github/PULL_REQUEST_TEMPLATE.md) records checks, untested boundaries and permission to contribute under the existing applicable licenses. CODEOWNERS routes reviews; required checks and approvals must also be enabled in repository settings.
Expand Down Expand Up @@ -39,6 +41,8 @@ pnpm verify

`pnpm verify` runs the complete gate list in the same order as GitHub CI. Normal PR and main-branch checks use Node.js 24 on Linux and macOS. The Linux job runs the full profile; the macOS job uses `pnpm verify --profile platform`, which omits only the duplicate TypeScript compiler check. Windows runs the focused `pnpm verify --profile windows` contract on PRs; the profile is Windows-only and fails closed elsewhere. It checks source inventory, release tooling, build boundaries, artifacts, and Windows-specific tests without running the full capability suite. Gates that depend on platform behaviour are selected by platform rather than skipped silently; run `pnpm verify --list`, `pnpm verify --profile platform --list`, or `pnpm verify --profile windows --list` to inspect each plan. Individual gates remain available as their own scripts, such as `pnpm typecheck` or `pnpm test:byok`, while you iterate.

`pnpm lint` (or `pnpm lint:tui`) checks TUI source and tests with the source repository's Airbnb, TypeScript, import and Prettier rules. Errors fail verification; formatting, unused variables and explicit `any` remain warnings, matching the source policy. The scripts use `--quiet` to keep existing warning debt out of CI logs; omit it when invoking ESLint directly to inspect warnings. The audited Pi engine retains its narrow style exceptions; its public facade uses the normal rules. Vendored Pi test copies are excluded. Full, platform, archive and Windows verification include this gate; docs and package-installation profiles do not.

CI writes per-gate timing and exit metadata to the Job Summary and a seven-day `verification-<os>-node-<version>-<attempt>` artifact. For a local report, set `MCODE_VERIFY_REPORT_DIR` to a directory outside the repository. Reports distinguish `PASS`, `FAIL`, intentional `SKIP`, and `NOT_RUN` after a failure. JSON is checkpointed before and after each gate; a cancelled run may leave `RUNNING`, which is not a pass. If installation fails before verification starts, no verification report is available. Reports do not collect command output, environment variables, or runtime data; read the corresponding gate's job log for failure details, including the existing bounded BYOK timeout diagnostics. CI jobs have a 15-minute verification limit and a 10-minute release-audit limit.

Existing README files, `CONTRIBUTING.md`, `.github/PULL_REQUEST_TEMPLATE.md`, Markdown under `docs/`, and media directly under `docs/assets/` use the `docs` profile when they are the only changed paths. That profile checks the source inventory and generated paths, exports the committed source, and tests release tooling. History and source-snapshot secret scans still run; platform builds and distribution scans are skipped. Mixed changes, unknown paths, missing comparisons, and any `release/` inventory change get full CI. Documentation-only changes skip the platform matrix entirely. The `verification` aggregate check always runs and rejects failed, cancelled, or unexpectedly skipped jobs. Use it together with `source-history-artifact` as required checks when configuring branch protection; this repository's automation does not change administrative settings.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Inside the TUI, use `/sessions` to find previous sessions and `/help` to see all
| Reference a workspace file or directory | `@` |
| Toggle Plan Mode | `Shift+Tab` |
| Switch permission modes | `Alt+M` |
| Close a panel or interrupt a running task | `Esc` |
| Close a panel or interrupt a running task; interrupting before the model replies returns the message to the composer | `Esc` |

## Uninstall

Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ kcode --session
| 引用工作区文件或目录 | `@` |
| 切换 Plan Mode | `Shift+Tab` |
| 切换权限模式 | `Alt+M` |
| 关闭面板或中断正在运行的任务 | `Esc` |
| 关闭面板或中断正在运行的任务;在模型回复之前中断会把消息放回输入框 | `Esc` |

## 卸载

Expand Down
20 changes: 20 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ custom_provider:

[Live acceptance](verification.md) separately verified MiniMax Token Plan and one configured BYOK provider. This is not a guarantee for every compatible service.

### Prompt-cache session affinity

A relay that routes prompt-cache hits per session needs to recognize which session a request belongs to. MCode never derives that from the Anthropic `metadata.user_id` field: `metadata` is forwarded only when a caller sets it explicitly, because it is an abuse-detection and attribution field rather than a cache key. The supported mechanism is the `sendSessionAffinityHeaders` compatibility override, declared per model under `compat`:

```yaml
custom_provider:
my-relay:
options:
apiKey: sk-relay-key
baseURL: https://relay.example.com
models:
MiniMax-M2:
compat:
sendSessionAffinityHeaders: true
```

With the override enabled, every request carries the current session id as `x-session-affinity`. An `openai-completions` provider additionally sends the same value as `session_id` and `x-client-request-id`. Key the relay's cache routing on those headers. Requests made with cache retention disabled send no session headers at all; leave the routing fallback in place rather than treating a missing header as a new session.

The override defaults to `false`, so a provider that ignores these headers is unaffected; it is enabled automatically only for endpoints known to require it, such as Fireworks and the Anthropic route of Cloudflare AI Gateway. `compat` accepts further per-model capability overrides, and each value is applied only when it has the declared type, so a quoted `"false"` is discarded rather than read as true. Restart MCode after editing configuration.

## 3. Search and image input

For a custom BYOK model, declare image input support explicitly when adding the
Expand Down
14 changes: 14 additions & 0 deletions docs/maintainers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ Route security reports through [Security](../SECURITY.md). Do not ask for secret

This small label set draws on the type and information-request handling in [VS Code's triage guide](https://github.com/microsoft/vscode/wiki/Issues-Triaging) and the `needs-triage`/`needs-info` states used by [Ruff](https://github.com/astral-sh/ruff/labels). Contribution eligibility follows this repository's policy.

## Pull request labels

Use the existing labels to describe a PR on three independent axes:

| Axis | Labels and meaning |
| --- | --- |
| Change type | `bug`: fixes a malfunction; `enhancement`: adds or improves behavior, including performance; `documentation`: primarily changes documentation; `dependencies`: updates dependencies |
| Product | `cli`: changes the standalone CLI, its runtime or its build; `tui`: changes interactive-terminal behavior and is used together with `cli`; `desktop`: changes the Desktop app |
| Verification | `perf:full`: selects the full performance suite for changes covered by the [performance rules](../CONTRIBUTING.md#performance-checks) |

Add one primary change-type label when a PR fits one of these types. Leave it unset for repository maintenance that fits none of them. Add each affected product label; leave product labels unset for repository-wide policy or tooling changes with no specific product impact. Classify the behavior and scope of the PR, not just its title or changed paths. The author proposes the labels and the reviewer checks them when the scope changes.

Keep `perf:full` until merge when the performance rules require it, including for dependency updates that affect the covered runtime paths. It is a verification trigger, not a change type or a statement that the PR is ready to merge. Use GitHub's draft state, reviewers, approvals and checks for review progress. `needs-triage` and `needs-info` remain issue-triage labels.

## Review and merge

1. Repository collaborators open an issue for substantial scope or submit a focused feature-branch PR. Other users may open issues to discuss ideas and proposals. Security details follow the private reporting process.
Expand Down
Loading
Loading