Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

fix: port a batch of upstream reliability fixes - #68

Merged
YaseenHQ merged 15 commits into
mainfrom
fix/upstream-fix-batch1
Aug 23, 2026
Merged

YaseenHQ merged 15 commits into
mainfrom
fix/upstream-fix-batch1

Conversation

@YaseenHQ

Copy link
Copy Markdown
Owner

Thirteen upstream fixes that apply to code this fork shares, selected by testing each one rather than by reading commit logs.

How these were chosen. Of 48 upstream fixes that looked missing, 2 turned out to be superseded upstream (one was reverted outright) and 33 collide with work this fork has done since — those need per-fix judgment and are not in this PR. These 13 are the ones that apply without contest.

What's in it

  • kap-server WebSocket heartbeat, so proxies stop dropping idle sessions
  • footer git-status commands resolve through PATH, not the working directory
  • background task output sanitized before display
  • banner stays readable with long tags on narrow terminals
  • Windows explorer /select, handles quoted paths
  • question ids containing colons resolve
  • Gemini tool-call thought signature keeps its order
  • a cron turn ending no longer hides the previous answer
  • three vscode webview fixes, plus content-hashed web asset caching

Two needed adapting, not applying verbatim:

  • The turn-ended-time test typed its callback ProjectorBusEvent — a name upstream introduced in a projector refactor we don't have. Ours is DomainEvent, which the rest of that file already uses.
  • The git-status fix depends on a PATH-resolving helper we never had, so it came across too. It refuses candidates inside the working directory, so a planted binary can't run ahead of the workspace trust gate — relevant now that we test Windows.

Tested: full suite 17,084 passed / 0 failures, typecheck, lint, sherif and build all clean.

wbxl2000 and others added 14 commits August 22, 2026 22:49
…otAI#2393)

* fix(vscode): keep sign-in reachable from the no-models screen

* fix(vscode): stop flagging bundled this.require(...) calls as VSIX runtime dependencies

(cherry picked from commit 6d0a046)
… context (MoonshotAI#2326)

Co-authored-by: rickgao <rickgao@tencent.com>
Co-authored-by: qer <wbxl2000@outlook.com>
(cherry picked from commit 302b2cd)
…onshotAI#2585)

* fix(kap-server): accept question ids containing colons on resolve

Some OpenAI-compatible providers emit tool_call ids like
`AskUserQuestion:0`, which the question service adopts as the question
id. The action-suffix parse then rejected the bare resolve POST as an
unsupported action (40001), so clients could never submit answers.

When the suffix parse fails, fall back to matching the full tail
against the pending question list before emitting 40001. Also add
maxRetries to the test home cleanup to absorb the async query-store
shard flush (ENOTEMPTY on macOS), matching fs.test.ts.

* fix(kap-server): preserve 40902 on duplicate resolve of colon-id questions

A retried bare resolve of a colon-bearing question id re-entered the
invalid-suffix fallback after the question settled, found no pending
match, and returned 40001 — bypassing the recently-resolved idempotency
window. Accept the tail in the fallback when it is recently resolved so
the shared duplicate-resolve path emits 40902 as documented.

(cherry picked from commit c396873)
…dows (MoonshotAI#2645)

explorer.exe parses its raw command line rather than argv, so Node's
default spawn quoting breaks the `/select,` argument whenever the path
contains spaces: the command line becomes `"/select,\"C:\...\""`, which
explorer rejects, silently opening the Documents folder instead of
selecting the file. Quote only the path portion and launch with
windowsVerbatimArguments so the command line keeps the documented
`/select,"C:\some dir\f.txt"` form.

(cherry picked from commit 2b89373)
…ts (MoonshotAI#2813)

The v1 WS connection had no keepalive: by design it stayed open until the
client disconnected, which only holds for direct connections. Behind a
reverse proxy or gateway with an idle timeout (30s defaults are common),
any quiet stretch — e.g. waiting on a slow model response — got the
connection killed, surfacing as a recurring 'Realtime connection error'
in the web UI.

Send an application-level ping every 10s and advertise heartbeat_ms in
server_hello (the schema and all shipped clients already answer pong).
Application-level rather than protocol-level ping because browser JS
cannot observe the latter, and the client's stale-socket detector keys
on incoming message frames. Any inbound frame refreshes liveness; after
two silent cycles the connection is presumed half-open and closed with
1001 so dead peers get reaped instead of leaking.

(cherry picked from commit 619564d)
…shotAI#2838)

The footer git status cache spawns git (and gh for PR lookup) on the
startup path, before the workspace trust prompt. On Windows, a bare
command name lets cmd.exe resolve a git.exe planted in the workspace
before the user confirms trust — a gap left by MoonshotAI#2695.

Resolve git once at cache creation and gh per lookup with
resolveCommandPath(), which returns an absolute PATH hit and refuses
matches inside the workspace; when resolution fails the cache reports
no repository instead of spawning anything.

(cherry picked from commit e5be391)
…minals (MoonshotAI#2884)

* fix(tui): keep banner main text readable with long tags on narrow terminals

The banner layout inlines the tag and wraps the main text into the
remaining width. Remote banner configs can set a full-sentence tag
(e.g. the 38-char K3 thinking-effort banner), which on narrow terminals
leaves the main text only a few columns, so it wraps into a ragged,
hard-broken column ("balan/ce", "capab/ility").

When the inline tag would leave the main text fewer than 16 columns,
render the tag on its own line and give the main text and subtext the
full width, aligned with the tag text. Short tags stay inline; tags
wider than the terminal are still dropped as before.

* chore: add changeset for banner narrow-terminal fix

---------

Co-authored-by: Mira <mira-bot@moonshot.cn>
(cherry picked from commit 1811bd4)
Co-authored-by: liruifengv <liruifeng1024@gmail.com>
(cherry picked from commit 245e3d5)
…ailing user text order (MoonshotAI#2914)

* fix(agent-core-v2): preserve tool call extras in tool.call loop events

* fix(google-genai): keep trailing user text before function results when merging

---------

Co-authored-by: Selene <mahaoyang@corp.netease.com>
(cherry picked from commit 1cf617d)
* fix(protocol): expose turn ended event time

* fix(protocol): expose turn ended event time

* chore(changeset): remove patch release entry

* test(node-sdk): align background task parity expectations

(cherry picked from commit 3ded080)
Two ports needed adjusting rather than applying verbatim:

- The turn-ended-time test typed its feed callback as ProjectorBusEvent,
  a name upstream introduced when it refactored the projector event
  union. This fork still calls it DomainEvent, which every other test in
  that file already uses.
- The footer git-status fix depends on a PATH-resolving helper this fork
  never had. Bring the helper and its tests across too: it refuses
  candidates inside the working directory, so a binary planted in an
  untrusted workspace cannot run before the trust gate does.
@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d8960d76-93cd-4d5f-92c6-0035f39f918e


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The cherry-picks carried upstream's own changeset files, which bump
@moonshot-ai/kimi-code and kimi-code. Neither exists in this workspace,
so `changeset status` fails outright. This fork publishes only echadron,
and the batch changeset already covers these fixes for the changelog.
@YaseenHQ
YaseenHQ merged commit 2c4e725 into main Aug 23, 2026
15 checks passed
@YaseenHQ
YaseenHQ deleted the fix/upstream-fix-batch1 branch August 23, 2026 03:09
@github-actions github-actions Bot mentioned this pull request Aug 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants