Repository navigation
Feat/ai custom endpoint - #41
Merged
Merged
Conversation
Agents could only talk to the two hardcoded presets, which locks out reverse-proxied subscriptions and every provider we ship no preset for (DeepSeek, Moonshot, a local server). Closes #28. Provider ids become plain strings: the built-in presets stay in code, while user-defined endpoints live in config as {id, label, baseUrl} entries referenced by agents. Keeping the endpoint an entity rather than an AgentConfig field means several agents can share one endpoint and its API key — and deleting the last agent that uses a custom endpoint takes the endpoint and its key with it, so no orphan credentials are left in ai.json. normalizeChatEndpoint accepts the three shapes people actually paste: a bare host gets /v1/chat/completions, a version segment (/v1, /v1beta, /openai/v1) only gets /chat/completions, and a full chat-completions URL is passed through untouched as the escape hatch for gateways that route differently. completeAgentChat now takes the resolved endpoint instead of a provider id, so the transport layer no longer owns an endpoint table; a run whose custom endpoint has since been deleted fails with a clear message rather than a bad request. scripts/verify-ai-endpoint covers URL normalization and the provider registry (upsert in place, key retained across edits, key removed with the endpoint, dangling reference resolves to empty).
On desktop with a Chinese IME on, the picker vanished the instant it appeared and the agent could never be summoned again. WKWebView holds a character's keydown back until the composition engine releases it (keyCode 229), so it arrives a few milliseconds AFTER the beforeinput that opened the picker — and PickPane's "any other key dismisses" rule then closed the picker on the very keystroke that opened it. It looked intermittent because the first "@" of a session is typically typed in ASCII mode; writing one Chinese instruction in the composer leaves the IME in Chinese and every later "@" dies. The keydown still carries its original hardware timestamp, which predates the popover, so the picker now only accepts dismissal from keys pressed after it appeared. Using the trigger event's timestamp rather than the mount time keeps a character typed a few ms after the "@" a real dismissal. Keys owned by a live composition are ignored too. Also guard the composer's Enter with isComposing: confirming an IME candidate was submitting a half-typed instruction.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What this changes
Which layer does this touch?
.packages/@do-md/core/) — GPL-3.0How it was verified
Contributor License Agreement
automated check asks.