Skip to content

0.3.7 - #1236

Merged
XingYu-Zhong merged 168 commits into
masterfrom
develop
Aug 28, 2026
Merged

0.3.7#1236
XingYu-Zhong merged 168 commits into
masterfrom
develop

Conversation

@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

No description provided.

XingYu-Zhong and others added 30 commits August 22, 2026 00:06
A turn parked on a user_input gate kept showing generic running indicators,
so users did not realize the agent was waiting for their answer.

- shared hasLivePendingUserInput(blocks) helper (live pending only, not
  stale history records)
- timeline live progress row swaps the thinking label/work logo for an
  amber pulsing awaiting label
- SessionHeader and WorkbenchChatStage badges switch from Running to an
  amber awaiting badge with icon while awaiting
- background threads fire one OS notification (deduped by input id) via
  the existing turn-complete notification channel
- i18n keys awaitingYourInput / userInputNotificationTitle/Body in 7 locales
…g decorator

Object-spread wrapping in withModelTiming dropped every prototype member of
the wrapped ModelClient, including selectsRouteTargetDuringStream and the
model getter. The agent loop then froze the public route-gateway alias
(route-gateway:local/kk) as the acting route, and onRouteSelected failed the
whole turn when the pool resolved a concrete target. Restore prototype
delegation so only stream is decorated, and accept a late alias-to-target
resolution in onRouteSelected as a defensive fallback.
- Added `stopServiceManagerForReplacement` function to handle graceful and forced shutdown of the service manager.
- Created unit tests for the manager replacement logic to ensure correct behavior under various scenarios.
- Introduced `KunOwnerVerificationError` for better error handling during manager replacement.
- Updated `startup-failure-content` to include detailed presentation for handoff errors.
- Enhanced `showStartupFailureWindow` to support recovery actions during startup failures.
- Refactored related functions and types for clarity and maintainability.
…hread logs

- SSE bridge retries thread-events 404 with bounded backoff (750ms x3)
  before surfacing a terminal threadMissing error, closing the
  create-vs-subscribe race that stranded empty transcripts.
- highestSeq scans the events.jsonl tail backwards instead of
  stream-parsing the whole log on every cache miss (#621 family);
  malformed tails fall back to the full forward scan.
- Slow non-streaming route handling now logs method+path over 500ms.
- Health probe budget for ensure matches the watchdog (2s -> 5s).
- Workflow webhook /workflow/run caps concurrent synchronous runs.
…g-input hint

- user_input/request_user_input accept timeoutSeconds (5-3600); on elapse
  the gate self-resolves with status timeout and the tool result instructs
  the model to proceed with its own best judgment instead of re-asking
- timeout wiring shared by the main bridge and agent-sdk/cursor factories;
  contract events, turn items, and replay reducer carry timeoutSeconds
- GUI shows a countdown chip on the ask-user panel, a timeout terminal
  state on the timeline bubble, and a distinct amber pulse indicator on
  sidebar rows whose thread is awaiting the user's answer (sorted first)
- awaiting-input registry hydrates from pendingUserInputIds on thread
  switch/restart and clears on resolution or turn completion
A conversation's stored model selection could be silently reverted to
the model used for the first message via three paths:

- loadComposerModels overwrote a source:'user' stored selection with a
  fallback whenever the refreshed catalog temporarily lacked the model
- draining a queued message rewrote the selection with the stale model
  captured at enqueue time, clobbering a newer picker change
- composerSelectionForThread fell back to the first-sent thread model
  before the model catalog had loaded, flashing the wrong selection

Now a user selection survives catalog refreshes and queue drains, and
thread switching keeps it visible until the catalog is actually ready.
…hread

Reopening a thread trusted the persisted snapshot's running claim, so the
timeline rendered live-progress rows, running tool rows, and a typewriter
replay before recovery settled the turn. Add a busyUnconfirmed flag set by
snapshot hydration (selectThread / subscribeThreadEventsLive /
recoverActiveTurn) that renders history settled until the live event stream
confirms the turn (first accepted user/tool/delta/compaction event) or a
terminal event clears it. Input/disabling still follows busy, so a genuinely
running turn keeps its composer gating while confirmation is pending.
The typewriter gate subscriptions landed inside conditional branches,
violating react-hooks/rules-of-hooks and risking a hook-count crash if a
bubble's kind or streaming flag ever changed mid-mount. Hoist both to the
top of their components; behavior is unchanged.
A silent Fast Context child that spent its retrieval budget without a
final text answer had its summary sourced from a stringified tool_result
or duplicated loop error text, and fatal-looking loop bookkeeping errors
flipped completed runs to failed. That produced self-contradictory
"failed + status: completed" cards.

- Bound the childResultSource tool_result fallback preview
- Let a Fast Context evidence pack outrank fake no-text summaries
- Sanitize failed-record error text that self-describes completion
- Downgrade legacy contradictory failed details in the card status
Second-pass review follow-up of 71a73a1:

- Scope the runtime-error exemption to whitelisted loop bookkeeping codes
  (model_empty_response, empty_post_tool_continuation,
  tool_loop_suppressed); other fatal errors still fail the child
- Distinguish the evidence-pack placeholder summary by terminal status
  (completed vs incomplete)
- Mark the bounded tool_result fallback preview with an ellipsis so
  truncated JSON is never mistaken for a complete payload
- Pin the card status downgrade to Fast Context bad records that carry
  an evidence pack, keeping genuine failures red
…andling

- Added `getThreadStates` method to `AgentProvider` for batch retrieval of thread states.
- Updated `KunRuntimeProvider` to utilize the new batch endpoint and handle per-thread failures.
- Introduced `loadThreadStates` utility to manage fallback to single-thread reads when batch retrieval fails.
- Enhanced `syncTurnCompletionPoll` to prefer batch reads for multiple threads and limit concurrent single reads.
- Updated sidebar activity management to reflect awaiting user input states based on thread state responses.
- Added tests for new functionality, ensuring correct behavior for batch reads and state management.
Extract per-million-token pricing from the models.dev catalog (input,
output, cache_read, cache_write) instead of dropping cost fields, persist
it through model profiles into the kun runtime config, and use it as the
last-resort local cost estimator when the provider reports no cost and no
first-party estimator (DeepSeek/MiniMax) matches. Free models now show a
zero estimate instead of "Price unavailable".
User message images were rendered in a fixed 3:2 box with object-cover,
so small screenshots were scaled up and cropped beyond recognition. Read
the natural size on load and shrink-only fit each tile within per-variant
max constraints, centering the full image instead of cropping it. The
composer thumbnail also switches to object-contain.
- Introduced fine-grained error codes for thread state loading failures, including 'owner_unreachable', 'owner_error', 'schema_incompatible', and 'storage_error'.
- Created a new ThreadStateLoadError class to encapsulate error details and improve error handling in the thread state loading process.
- Updated the getThreadStates function to map specific errors to the new error codes and log structured diagnostics.
- Added tests to verify the mapping of errors to fine-grained codes and ensure proper logging behavior.
- Implemented a mechanism to recover plans from metadata when the plan store is empty or inconsistent, enhancing user experience during plan operations.
- Updated UI components to support the new plan metadata structure and ensure compatibility with the updated error handling.
Stop reordering sidebar rows by activity state. Poll/SSE refreshes flip
running/awaiting-input state every few seconds, so bucketing rows by
activity made the list jump under the user's pointer. Activity now only
drives row indicators; prioritizeSidebarThreadActivity keeps caller order.

Freeze each thread's sort anchor (its updatedAt) when a turn starts so
the per-event updatedAt bumps no longer bubble the row upward. The anchor
releases when the turn settles, letting the row land once on its final
position. Pin and manual drag order still apply immediately.
…g pricing

Subscription and token-plan models (Kimi Code, etc.) showed "price
unavailable" because the aggregation layer drops costUsd for
subscription billing and the Codex value estimator only knows OpenAI
models. Normalize a catalog-pricing value estimate for subscription
requests, aggregate it when the Codex estimator has no price, prefetch
the catalog at startup to hydrate preset model profiles, and give the
Kimi Code preset static reference prices mirroring the public Moonshot
API so estimates work offline too.
GLM Coding Plan models were still shown as price unavailable because
models.dev publishes them with explicit zero pricing, the startup catalog
prefetch raced ahead of runtime configuration, and legacy usage records
lacked billingKind. Add GLM-5.3 to presets with zero pricing, await
pricing hydration before starting Kun, recover per-turn provider
attribution for historical usage, and classify only zhipu/zai Coding Plan
GLM records as complete zero-price reference estimates.

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33099665714

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33102508770

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33110394947

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33117629884

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33119446238

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33121708018

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33125952730

@github-actions github-actions 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.

PR checks failed. Please fix the failing CI jobs before merging.

Failed jobs:

  • Build Windows NSIS installer (PR)

Run details: https://github.com/KunAgent/Kun/actions/runs/33130061173

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.

1 participant