fix: enable thinking for zhipuai-coding-plan & prevent Korean IME truncation#22041
Merged
rekram1-node merged 5 commits intoanomalyco:devfrom Apr 11, 2026
Merged
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Double-defer onSubmit with nested setTimeout to ensure the last composed character (e.g. Korean hangul) is flushed to plainText before submission. A single setTimeout(0) is insufficient because the EditBuffer content change callback may not have fired yet.
The double-defer workaround in onSubmit may fire before onContentChange flushes the last IME-composed character to the store. Read input.plainText directly and sync both the store and extmark positions before any downstream reads in submit(). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #22042
Related: #8652, #14371
Type of change
What does this PR do?
Two fixes:
1. Enable thinking for zhipuai-coding-plan provider
When using the Z.AI Coding Plan (
zhipuai-coding-planprovider) with reasoning models like GLM-5.1, the agent returns empty responses because thethinkingconfiguration is not being properly applied in the provider transform logic. This PR usessome((id) => input.model.providerID.includes(id))instead of strictincludesso any provider ID containing "zai" or "zhipuai" gets the thinking config.2. Prevent Korean IME last character truncation on submit
When typing Korean (hangul) in Kitty and other terminals, pressing Enter to submit truncates the last composed character. The
onSubmithandler fires synchronously before the IME composition commit flushes toplainText.Fix: double-defer the submit call via
setTimeout(() => setTimeout(() => submit(), 0), 0)to give the event loop enough ticks for the IME composition to commit. Adds ~0-2ms latency to submit, imperceptible to users.How did you verify your code works?
bun typecheckpassesbun run test)Screenshots / recordings
N/A (terminal behavior)
Checklist