Skip to content

Open Router - Hugging Face - UI Improvement#7

Merged
bigbansal merged 9 commits into
mainfrom
codex-ide-feature-foundation
May 27, 2026
Merged

Open Router - Hugging Face - UI Improvement#7
bigbansal merged 9 commits into
mainfrom
codex-ide-feature-foundation

Conversation

@bigbansal
Copy link
Copy Markdown
Contributor

Establishes the CodeSetu pnpm + Gradle monorepo and the first
working
products for both IDEs: an open-source, multi-provider AI coding
assistant and a Postman-style API client.

AI coding assistant

  • Multi-provider chat: Sarvam, OpenAI-compatible (Ollama / vLLM /
    SGLang
    / OpenRouter / local), and Hugging Face (hosted router,
    dedicated
    Inference Endpoints, or self-hosted TGI).
  • VS Code (apps/vscode): chat webview with streamed,
    markdown-rendered
    replies; inline FIM completions; selected-code actions (explain
    /
    refactor / tests / fix / docs); provider setup + diagnostics;
    in-chat
    provider/model switcher.
  • JetBrains (apps/jetbrains): chat tool window rendered in JCEF
    using the
    same design as VS Code; editor actions; settings; in-chat
    provider/
    model switcher.
  • API keys stored securely — VS Code SecretStorage and JetBrains
    PasswordSafe — never in settings.json or plaintext XML; env-var
    fallback retained.
  • Repo-aware context (active file, selection, cursor
    neighborhood,
    related snippets) with secret-file exclusions; workspace
    skills/checks.

Shared packages

  • @codesetu/core: provider factory +
    OpenAI-compatible/Sarvam/Hugging
    Face clients, IDE context/prompt/diagnostics, tool registry.
  • @codesetu/plugin-sdk: plugin and skill type contracts.

API client (standalone, Postman-style)

  • packages/api-client-core (TS engine) plus apps/vscode-apiclient
    and a
    native-Kotlin apps/jetbrains-apiclient: collections,
    REST/WebSocket
    requests, environments, auth, importers (Postman/OpenAPI/cURL/
    Insomnia/HAR), and persistence.

Tooling & CI/CD

  • CI (PRs to main): format, build, lint, test, VSIX
    smoke-package; a
    JetBrains matrix over both plugins running build + test +
    JetBrains
    Plugin Verifier.
  • Release workflows: VS Code (Marketplace + Open VSX) and
    JetBrains
    (Marketplace), version = major.minor + run_number, with
    dry-run.
  • Apache-2.0 headers, ESLint (type-checked) + Prettier,
    README/INSTALL/
    CONTRIBUTING/SECURITY and issue/PR templates.

199 files across the assistant, API client, shared packages, and
CI.

bigbansal and others added 9 commits May 27, 2026 22:21
Security:
- VSCode: store the provider API key in SecretStorage instead of
  settings.json (which syncs in plaintext). Migrate + clear any legacy
  value, deprecate the codesetu.apiKey setting, cache the key in memory
  and refresh on change.
- JetBrains: store the API key in PasswordSafe instead of the plaintext
  settings XML, with one-time migration off the legacy field.

JetBrains chat correctness:
- Include workspace skill/check bodies in the system message (were
  loaded then silently dropped).
- Keep multi-turn conversation history instead of single-turn.
- Capture editor context on the EDT; load workspace instructions inside
  a read action.
- Skip malformed SSE chunks instead of aborting the whole stream.

VSCode chat UX:
- Show the real configured provider/model in the composer; remove the
  non-functional model/reasoning/plugins/permissions/plan/goal controls.
- Render assistant messages as HTML-escaped markdown (code fences,
  inline code, bold, lists) with no XSS surface.
- Trim transcript history to a char budget; drop the optimistic user
  turn on error so retries don't stack two user messages.
- Exclude likely-secret files (.env, keys, secrets/) from the
  auto-collected workspace snippets.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Core:
- Add HuggingFaceProvider (extends OpenAICompatibleProvider): default
  base URL https://router.huggingface.co/v1, HF_TOKEN auth, default
  chat model. Register in the factory, exports, and diagnostics. It does
  not send Sarvam's reasoning_effort (which HF-served models reject).

VS Code:
- Add "huggingface" to the provider enum and the Setup Provider picker
  (router default + hf_... token prompt, key stored in SecretStorage).
- Add a "CodeSetu: Select Model" command and make the composer model
  chip clickable: a curated list of reliably-served HF chat models plus
  an "Enter a custom model id..." option; writes codesetu.model and
  updates the chip live.

JetBrains (provider backend):
- Add ProviderKind.HUGGING_FACE; gate reasoning_effort to Sarvam only in
  the provider client so HF / OpenAI-compatible models don't get an
  unsupported field.

Docs: README provider list, prerequisites, and settings updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add CodeSetuModelCatalog with a curated list of reliably-served
  Hugging Face chat models.
- Add an editable model ComboBox to the chat tool window header
  (dropdown of curated models + free-text for any custom repo id /
  endpoint model) that writes CodeSetuSettingsState.model, so switching
  models is at parity with the VS Code composer chip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rework the Swing chat panel into a proper chat layout:
- Model bar on top, transcript in the middle, and a bottom composer with
  a growing input and a normal-sized Send anchored bottom-right (the
  Send button no longer spans the full window height).
- Word-wrap the transcript and input, add padding, a placeholder, and
  ⌘/Ctrl+Enter to send.
- Add an in-flight guard (the keyboard shortcut bypasses the disabled
  button) and disable input/model box while a response streams.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the Swing chat tool window with a JCEF webview that reuses the
exact VS Code chat design — rounded composer, clickable provider·model
chip, "Include IDE context" toggle, and HTML-escaped markdown rendering
of streamed replies.

- webview/chat.html: shared markup/CSS/markdown JS (authored as a real
  resource to avoid hand-porting CSS), adapted to a JCEF bridge.
- ChatTheme: maps the current IDE theme onto the --vscode-* CSS
  variables the design uses, so it matches light/dark.
- ChatWebviewHtml: loads the template and substitutes theme, model
  label, and the JBCefJSQuery post-bridge.
- CodeSetuToolWindowFactory: drives the page over a JBCefJSQuery bridge
  (sendMessage/selectModel/ready in; streamed deltas, model label, busy,
  errors out), with a model-picker popup, multi-turn history, EDT-safe
  context capture, outgoing-message buffering until the page loads,
  disposal, and a JCEF-unsupported fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add a "Configure provider / endpoint…" entry to the model picker on
  both platforms so users can switch between Sarvam, OpenAI-compatible
  (Ollama / vLLM / local), and Hugging Face — and set the base URL,
  model, and API key — without leaving the chat. VS Code hands off to
  the Setup Provider command; JetBrains runs an inline provider/baseURL/
  model/token flow and stores the token in PasswordSafe.
- Compact the JetBrains JCEF chat: drop the redundant heading (the tool
  window already shows "CodeSetu"), and tighten padding, composer size,
  and icon/button sizes so it fits a narrow tool window.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Set pluginVersion (gradle.properties) and package.json to 0.2.0 and add
0.2.0 change notes covering the webview chat UI, Hugging Face provider,
in-chat provider/model switching, and PasswordSafe key storage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- ci.yml: add a JetBrains job (JDK 21 + Gradle) that runs compileKotlin,
  compileTestKotlin, test, and buildPlugin and uploads the zip. Kotlin
  was previously never built or tested on PRs (the Node scripts for
  apps/jetbrains are echo stubs).
- release-vscode.yml: hoist OVSX_PAT to job-level env so the Open VSX
  publish step's `if` can actually read it (step-level env is not
  visible in that same step's condition, so it was always skipped).
- Bump the VS Code extension to 0.2.0 (manifest + changelog) to align
  with the JetBrains 0.2.0 release.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Configure the JetBrains Plugin Verifier in both apps/jetbrains and
  apps/jetbrains-apiclient: add pluginVerifier() to the intellijPlatform
  dependencies and a pluginVerification block. Pin verification to the
  build target IDE (IC 2025.2.5) instead of recommended(), which tried
  to resolve an unreleased IDE (2025.3) and failed.
- ci.yml: run the JetBrains job as a matrix over [jetbrains,
  jetbrains-apiclient] and add `verifyPlugin` to the Gradle invocation.
- release-jetbrains.yml: also run `verifyPlugin` before publishing.

Both plugins verify Compatible against IC-252 locally.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@bigbansal bigbansal merged commit 937c974 into main May 27, 2026
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