fix(coding-agent): reject ctx.ui.custom() under daemon/RPC instead of silent no-op - #885
Open
pushpraj-core wants to merge 1 commit into
Open
Conversation
… silent no-op Adds ctx.ui.supportsCustom so extensions can detect terminal-takeover support instead of relying on ctx.hasUI. Fixes PrimeIntellect-ai#680
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.
Summary
Fixes #680
ctx.ui.custom()was silently no-opping under the daemon/worker architecture and over RPC, returningundefinedinstead of surfacing an error. This made it impossible for extensions to detect that terminal-takeover rendering wasn't available.Changes
ExtensionUIContext.supportsCustom(new property): areadonly booleanflag that extensions can check before callingcustom()to detect whether terminal-takeover rendering is supported in the current UI context.noOpUIContext(runner.ts):custom()now throws instead of returningundefined as never.daemon-extension-binding.ts):custom()now throws with a descriptive error explaining the daemon/worker limitation.rpc-extension-ui-context.ts):custom()now throws with a descriptive error explaining the RPC limitation.interactive-mode.ts): setssupportsCustom: truesince it owns a real terminal.How to test
ctx.ui.custom()from an extension running under the daemon — it should now throw instead of silently resolving.ctx.ui.supportsCustom— it should befalseunder daemon/RPC andtruein interactive mode.npx tsgo --noEmit -p tsconfig.build.jsonNote
Fix
ctx.ui.custom()to throw instead of silently no-op in daemon and RPC modessupportsCustom: booleanflag to theExtensionUIContextinterface so callers can check whether terminal takeover is available before callingcustom().ctx.ui.custom()now throws anErrorinstead of silently resolving; interactive mode setssupportsCustom: true.custom()silently no-oping in non-interactive contexts will now receive a thrown error.Macroscope summarized c9981c4.