Repository navigation
feat: ChatGPT Plan provider for inline completion and chat - #1
Draft
CoderLambert wants to merge 61 commits into
Draft
CoderLambert wants to merge 61 commits into
CoderLambert wants to merge 61 commits into
Conversation
…expired token (twinnydotdev#538) * Forge plugins: tokens saved once and shared by repositories, one replace for an expired token Repositories read with a saved token (by id) instead of a copy each. Inline tokens in repos.json are folded into saved tokens on load, deduped by value; repo ids are unchanged. Tokens panel: save, label, replace (checked with the host, then every repository on it syncs), remove when unused, and pick repositories a token reads. 401s mark the token and its repositories as refused. * 4.3.7: forge plugin tokens saved once and shared; one replace for an expired token
… of copying it mid-write (twinnydotdev#542) The Backups plugin and `backup now` read recordings.sqlite, -wal and -shm one after another while the gateway keeps appending. In WAL mode every row since the last checkpoint lives in -wal, so the main file alone can be an empty shell (a fresh database under ~4 MB of recordings backed up as "no such table"), and the three files read at different instants are a torn set SQLite itself says not to copy. A `.sqlite` file now goes into the archive as one consistent single-file database made with `VACUUM INTO` next to the original (same private directory, removed after reading); -wal and -shm are left out. Without node:sqlite the file is read as before. A restore also removes a stale -wal/-shm beside the database it writes, since a gateway that was killed rather than stopped leaves frames SQLite would replay over the snapshot. Standalone test under `npm run test:sqlite`; docs say what the archive holds.
…servers, team agent rules Agent mode applies edits straight away, so this makes that safe to live with, gives the model the context it was missing, lets a team's admin say what it may do, and fixes what an audit of the agent code found. A reply that changed files ends with the list of them; each opens beside what it was before the reply, and undo / undo all put files back through a workspace edit, so the editor's Undo brings the change back. Edits, new files, deletes, moves and renames are covered, and inside a git repository so are files a command changed: the tree is read before and after each command through a copy of the index. Copies are kept for the last 50 replies in workspace storage; a file changed since asks. An applied edit comes back with the new errors the editor reports in that file (in a file not open before, only errors on the changed lines). The root AGENTS.md (or CLAUDE.md, .github/copilot-instructions.md) goes into agent mode's instructions and a folder's own AGENTS.md comes with the first tool result under it; the footer names the files followed. A gear beside the agent switch sets changes apply/review, commands ask/run/off, background or terminal, steps per reply (new twinny.chatToolsMaxSteps) and forgets always-run commands. MCP servers in twinny.chatToolsMcpServers (stdio, hand-rolled JSON-RPC, no new dependency) add their tools, each call asked first unless Always run was chosen for that tool. Finished command steps can be copied or put in the terminal. policy.agent on the gateway turns agent mode off, makes commands ask or takes them away, makes edits wait for review, turns MCP servers off and hides paths from every tool. It is edited under Policy -> Agent mode, shown on the consent card, re-read before an agent reply and enforced by the extension; while it is set, the gateway refuses agent requests from extensions that do not send X-Twinny-Agent-Rules. Fixes from the audit, each with a regression test: the git tool read files outside the workspace (diff with an outside path, abbreviated --contents, --ignore-revs-file) and showed ignored-but-tracked files by blob id, :0:path, ./ and .. paths and --relative; links are judged by where they lead and a dangling link is not written through; protected paths match in any case and *.code-workspace is protected; background commands that left something running never finished; prose mentioning <tool_call>, held-back text, stray calls on the last step and parallel results trimmed before the model saw them; line-number stripping of "404: x" lines and blank lines left by deletions; a reply landing in the conversation switched to.
…and open the symbol
…ter mode A router-mode llama-server picks the model from the request body's "model" field and refuses a request without it. The llama.cpp FIM body (also used by warm-up) now carries the provider's model name when one is set; a single-model server ignores it. The /props context-window lookup names the model too, with autoload=false so asking never loads it. Fixes twinnydotdev#544
m1ab0t
force-pushed
the
feat/chatgpt-plan-completion
branch
from
October 15, 2026 15:29
7d707b5 to
2a454b6
Compare
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.
Goal
Add a dedicated ChatGPT Plan provider using OpenAI's official Sign in with ChatGPT flow and public Responses API. It supports inline completion and Twinny Chat with account models, without an API key.
Baseline
c8c1979c2a5371b2cb9bc2cc30914b06e628d567feat/chatgpt-plan-completionImplementation
Automated validation
npm cinpm run lintnpm run build-testsnpm run buildnpm test— 821 passing, 4 live-test pending, 0 failingnpm run test:sqlite— 109/109 passingnpm run vscode:package—twinny-4.3.6.vsixReal-account validation
gpt-6-lunaselected for FIM and Chatservice_tier: fastremoved after real route returnedUnsupported service_tier: fastReview
Architecture
CompletionProvider -> FimRequest -> InferenceClient -> ChatGPTPlanInferenceProvider -> /v1/responsesChat -> ChatRequest -> InferenceClient -> ChatGPTPlanInferenceProvider -> /v1/responsesNo Codex credential reuse, ChatGPT cookies, private backend APIs, or API-key fallback.
Draft until the remaining real-account inline-completion scenarios and current-head CI pass.