Skip to content

Add Azure / Foundry launch support to VS Code extension#1365

Merged
kevincodex1 merged 8 commits into
Gitlawb:mainfrom
l28bit:main
Jun 8, 2026
Merged

Add Azure / Foundry launch support to VS Code extension#1365
kevincodex1 merged 8 commits into
Gitlawb:mainfrom
l28bit:main

Conversation

@l28bit

@l28bit l28bit commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Added optional Microsoft Foundry / Azure OpenAI support to the VS Code extension launch flow.
  • Added openclaude.azure.* settings, Secret Storage support for the API key, command-palette actions, a setup wizard, and a Control Center shortcut for Azure / Foundry configuration.
  • Updated the OpenAI shim to support Azure-style deployment URLs, AZURE_OPENAI_API_VERSION, and OPENAI_AZURE_STYLE for Foundry/non-standard Azure hosts.
  • Added Windows PowerShell helper aliases and documentation for faster local OpenClaude setup and launch workflows.

This keeps Azure / Foundry setup out of committed config where possible, while making the VS Code terminal launch path work with enterprise Azure OpenAI deployments.

Impact

  • user-facing impact:

    • VS Code users can configure Azure / Foundry chat from the extension and launch OpenClaude with the required environment injected automatically.
    • API keys can be stored in VS Code Secret Storage instead of plain settings.
    • Windows users get documented helper commands like oc, oc-init, oc-local, oc-provider, and oc-check.
  • developer/maintainer impact:

    • Adds a scoped Azure / Foundry launch path without changing the default provider behavior.
    • Preserves existing openclaude.useOpenAIShim behavior, but avoids overriding the fuller Azure env when configured.
    • Documents the Azure shim behavior and Windows helper workflow for future maintenance.

Testing

  • bun run build
  • bun run smoke
  • focused tests:
    • node --check vscode-extension/openclaude-vscode/src/extension.js
    • PowerShell parser validation for scripts/windows/openclaude-aliases.ps1

bun was not available in my current Windows shell, so I could not honestly mark the full build/smoke checks as completed.

Notes

  • provider/model path tested:
    • Microsoft Foundry / Azure OpenAI-compatible path using CLAUDE_CODE_USE_OPENAI=1, OPENAI_BASE_URL, OPENAI_MODEL, OPENAI_API_KEY, AZURE_OPENAI_API_VERSION, and optional OPENAI_AZURE_STYLE=1.
  • screenshots attached (if UI changed):
    • Not attached.
  • follow-up work or known limitations:
    • Maintainers may want to run the full bun run build and bun run smoke checks in their normal dev environment.
    • The local checkout currently shows line-ending-only working tree noise; the GitHub compare itself shows the intended PR scope as 3 commits / 10 files.

Summary by CodeRabbit

  • New Features

    • VS Code extension: Control Center, in-editor chat actions, Microsoft Foundry / Azure OpenAI workflow with terminal env injection, secret-storage API key management, new Azure-related commands and settings.
  • Documentation

    • New Azure OpenAI advanced setup guide; updated README, VS Code docs, and Windows quick-start with Azure/Foundry guidance and Windows alias/launcher instructions.
  • New Tools

    • Windows PowerShell helper aliases and quick-launch commands (oc, oc-local, oc-fast, oc-init, oc-check, oc-help).
  • Chores

    • Packaging updated to include Windows scripts and Windows docs; extension manifest and activation metadata updated.

l28bit added 3 commits April 23, 2026 19:06
…penAI support. Added configuration options for Azure API key, endpoint, and deployment settings. Updated README and documentation for new features, including a setup wizard for Azure integration. Improved terminal launch environment handling for Azure compatibility.
Resolve conflicts by taking upstream extension, then restore openclaude.azure.* settings, Secret Storage key commands, wizard, Control Center quick link, and launch env merge for Microsoft Foundry / Azure OpenAI.

Made-with: Cursor
@kevincodex1 kevincodex1 requested a review from jatmn May 31, 2026 22:09

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found issues that need to be addressed before this is ready.

Findings

  • [P1] Rebase because the PR no longer merges cleanly
    docs/quick-start-windows.md:145
    The current PR branch conflicts with the target branch in docs/quick-start-windows.md when merged against the fetched base (git merge-tree FETCH_HEAD HEAD reports a content conflict in this file). The base branch has added extra guidance under the same "Need Advanced Setup?" section that this PR edits, so this branch cannot be merged as-is. Please rebase or merge the latest base branch and preserve both the existing advanced setup description and the new Windows aliases link.

  • [P2] Make the Windows aliases setup usable from the linked quick start
    docs/windows-aliases-and-launchers.md:12
    The Windows quick-start flow installs @gitlawb/openclaude globally, then links to this page, but the setup snippet points at a hard-coded local source checkout (C:\Users\Window\Documents\CFGit\openclaude) and dot-sources scripts\windows\openclaude-aliases.ps1. The published package only includes bin/, dist/cli.mjs, and README.md, so a user following the new quick-start link after npm install -g will hit Alias script not found unless they already cloned the repository to that exact example path. Please either document the source-checkout prerequisite and require users to set their own repo path, or package/install the alias script in a location the global-install workflow can actually use.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70093c42-41f4-4f63-8e0b-93c55c81a1d8

📥 Commits

Reviewing files that changed from the base of the PR and between 399f4e1 and 060fb57.

📒 Files selected for processing (2)
  • docs/windows-aliases-and-launchers.md
  • package.json
💤 Files with no reviewable changes (1)
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • docs/windows-aliases-and-launchers.md

📝 Walkthrough

Walkthrough

This PR adds Microsoft Foundry / Azure OpenAI terminal injection and VS Code controls (secret storage, wizard, Control Center wiring), expands OpenAI shim Azure detection/forcing, introduces Windows PowerShell alias/launcher scripts and docs, and updates package.json to publish the new artifacts.

Changes

Azure OpenAI Integration and Windows Tooling

Layer / File(s) Summary
Azure OpenAI Documentation and Overview
README.md, docs/advanced-setup.md, docs/quick-start-windows.md, vscode-extension/openclaude-vscode/README.md
Documentation describes resource base URL configuration, environment variable mapping (OPENAI_MODEL → deployment name, AZURE_OPENAI_API_VERSION, OPENAI_AZURE_STYLE=1), and VS Code integration for secure key storage and terminal environment injection. Windows quick-start links to advanced setup and new Windows aliases guide.
VS Code Extension Manifest and Configuration Schema
vscode-extension/openclaude-vscode/package.json, vscode-extension/openclaude-vscode/.vscode/launch.json
Extension manifest adds four new commands for Azure API key management and configuration wizard, activation events, and a comprehensive openclaude.azure.* configuration schema (enabled, endpoint, API version, deployment, force URL style, API key). Debug launch configuration simplified by removing preLaunchTask.
OpenAI Shim Azure Endpoint Detection
src/services/api/openaiShim.ts
Shim documentation and detection logic now support Azure OpenAI via OPENAI_AZURE_STYLE=1 forcing and expanded hostname matching (.azure.com, inference.ml), determining whether to emit Azure-style api-key headers and construct /openai/deployments/{deployment}/chat/completions URLs.
VS Code Extension Azure Configuration and Control Center
vscode-extension/openclaude-vscode/src/extension.js
Extension implements Azure setup helpers, API key resolution from Secret Storage, terminal environment construction for the OpenAI shim, and interactive configuration flows. Control Center gains an Azure/Foundry settings button. Terminal launch now builds environment dynamically; activate() registers Azure commands with subscriptions and deactivate() clears cached context.
Windows PowerShell Command Aliases and Launchers
docs/windows-aliases-and-launchers.md, scripts/windows/openclaude-aliases.ps1, package.json
New documentation and PowerShell script provide instant local launch (oc-init), daily commands (oc, oc-local, oc-fast, oc-check, oc-provider), and support functions for Ollama model validation, provider setup, and launch orchestration. These scripts/docs are added to the package files whitelist.

Sequence Diagram

sequenceDiagram
  participant User
  participant VSCode_Extension
  participant SecretStorage
  participant Terminal_Shell
  participant OpenAI_Shim
  participant Azure_OpenAI
  User->>VSCode_Extension: run configureAzureChat / set key
  VSCode_Extension->>SecretStorage: store API key
  User->>VSCode_Extension: launch OpenClaude (Control Center)
  VSCode_Extension->>Terminal_Shell: create terminal with injected OPENAI_*/AZURE_OPENAI_API_VERSION env
  Terminal_Shell->>OpenAI_Shim: make request using env
  OpenAI_Shim->>Azure_OpenAI: construct /openai/deployments/{deployment}/chat/completions with api-key header
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • jatmn
  • kevincodex1

Poem

🐰 Keys tucked safe in secret store,

Control Center hums and then some more,
PowerShell hops with aliases spry,
Shim finds Azure and builds the right sky,
A rabbit cheers: "Launch — let OpenClaude fly!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding Azure/Foundry launch support to the VS Code extension, which aligns with the extensive changes across documentation, configuration, and implementation files.
Description check ✅ Passed The PR description follows the template structure with Summary, Impact, Testing, and Notes sections. All major changes are documented, impact on users and maintainers is clearly explained, and testing performed is detailed with known limitations transparently noted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@l28bit

l28bit commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I addressed both requested items.

  • Merged the latest upstream/main into the PR branch and resolved the conflict in docs/quick-start-windows.md.
  • Preserved the updated advanced setup guidance while keeping the Windows aliases link.
  • Updated docs/windows-aliases-and-launchers.md so the setup no longer points to my local checkout path.
  • Added scripts/windows/openclaude-aliases.ps1 and docs/windows-aliases-and-launchers.md to the package files list so the global install workflow can resolve the alias helper from the installed package.

Validation performed:

  • npm pack --dry-run
  • Confirmed the tarball includes scripts/windows/openclaude-aliases.ps1
  • Confirmed the tarball includes docs/windows-aliases-and-launchers.md
  • PowerShell parser validation for scripts/windows/openclaude-aliases.ps1
  • node --check vscode-extension/openclaude-vscode/src/extension.js
  • bun run build
  • bun run smoke0.16.1 (OpenClaude)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 23-24: The published Windows helper references TypeScript
entrypoints that aren’t packaged; update either package contents or the helper:
either add the runtime scripts (scripts/provider-bootstrap.ts,
scripts/provider-launch.ts, scripts/build.ts, scripts/provider-recommend.ts) and
any required deps to the package.json "files" whitelist so profile:init,
dev:profile/dev:*, build and profile:recommend work, or modify
scripts/windows/openclaude-aliases.ps1 to call the compiled/installed CLI
artifacts (the built JS binaries or npm/bin commands) instead of using "bun run"
for the .ts files; pick one approach and ensure the referenced symbols
(profile:init, dev:*, build, profile:recommend and scripts/*.ts) are consistent
with the published package.

In `@scripts/windows/openclaude-aliases.ps1`:
- Around line 51-66: Replace use of the automatic $args variable with a
dedicated local variable (e.g., $bunArgs) used to build the argument array for
the bun call: initialize the new variable with
@("run","profile:init","--","--provider",$Provider), append model/goal/api-key
entries based on $Model, $Provider, $Goal, and $ApiKey exactly where the
existing code does, then invoke bun with the new variable instead of $args and
keep the existing $LASTEXITCODE check and error message for "profile:init
failed".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 52dc9409-2be7-4910-8c0f-b046b0e06165

📥 Commits

Reviewing files that changed from the base of the PR and between 96ddec7 and 07fcceb.

📒 Files selected for processing (11)
  • README.md
  • docs/advanced-setup.md
  • docs/quick-start-windows.md
  • docs/windows-aliases-and-launchers.md
  • package.json
  • scripts/windows/openclaude-aliases.ps1
  • src/services/api/openaiShim.ts
  • vscode-extension/openclaude-vscode/.vscode/launch.json
  • vscode-extension/openclaude-vscode/README.md
  • vscode-extension/openclaude-vscode/package.json
  • vscode-extension/openclaude-vscode/src/extension.js

Comment thread package.json
Comment thread scripts/windows/openclaude-aliases.ps1 Outdated

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the previously discussed paths and found one issue that still needs to be addressed.

Findings

  • [P2] Complete CodeRabbit's package-runtime request for the Windows helpers
    package.json:23
    CodeRabbit's package-runtime item is only partially addressed here. The package now includes scripts/windows/openclaude-aliases.ps1 and the top-level provider/build TypeScript entrypoints, but those entrypoints still import files that are not included in the published package, such as ../src/services/api/providerConfig.js, ../src/utils/providerProfile.ts, and ./provider-discovery.ts. In an extracted package built from this PR, bun run profile:init -- --provider ollama --model llama3.1:8b fails immediately with Cannot find module '../src/services/api/providerConfig.js', so the documented global-install alias flow still cannot run oc-init, oc-provider, or the bun run dev:* launch paths from the installed package. Please complete that review request by either packaging the full transitive runtime those scripts need, or by changing the helper to call packaged/bundled CLI artifacts instead of source-only Bun scripts.

@l28bit

l28bit commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for catching this. You were right the previous patch only addressed the top-level package whitelist and I should have followed the transitive runtime path further. Adding the TypeScript entrypoints was not enough because those scripts still depended on source files that are not part of the published package.

I reworked the Windows helper to avoid that source-checkout dependency entirely. The published helper no longer calls bun run, profile:init, dev:*, or source-only scripts/*.ts entrypoints. It now uses the installed openclaude CLI surface for the global-install alias flow, while keeping the local Ollama check/pull helper behavior in PowerShell.

Validation performed:

  • Installed Bun locally after the earlier environment limitation so the full Bun-based validations could be completed.
  • Confirmed the helper no longer references bun, profile:init, dev:*, profile:recommend, or source-only provider/build TypeScript entrypoints.
  • Confirmed the helper no longer assigns to PowerShell’s automatic $args variable.
  • PowerShell parser validation for scripts/windows/openclaude-aliases.ps1
  • npm pack --dry-run
  • Confirmed the package includes scripts/windows/openclaude-aliases.ps1
  • Confirmed the package includes docs/windows-aliases-and-launchers.md
  • bun run build
  • bun run smoke0.16.1 (OpenClaude)
  • node --check vscode-extension/openclaude-vscode/src/extension.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/windows/openclaude-aliases.ps1`:
- Around line 69-98: oc-local and oc-fast set process-scoped env vars
(CLAUDE_CODE_USE_OPENAI, OPENAI_BASE_URL, OPENAI_MODEL, and
OPENCLAUDE_FAST_MODE) and never restore them, causing later oc invocations to
inherit them; update both functions (oc-local and oc-fast) to save the previous
values of those env vars before setting them, wrap the Invoke-OpenClaude call in
a try/finally, and in the finally restore each env var to its prior value (or
remove it if it was undefined) so the environment is not sticky for subsequent
calls, or alternately document that these aliases are intentionally sticky if
you prefer that behavior (reference functions: oc-local, oc-fast; call:
Invoke-OpenClaude; affected env vars: CLAUDE_CODE_USE_OPENAI, OPENAI_BASE_URL,
OPENAI_MODEL, OPENCLAUDE_FAST_MODE; related logic:
src/utils/providerProfiles.ts).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 740f6d80-175d-403f-9110-db33c7511ea9

📥 Commits

Reviewing files that changed from the base of the PR and between c5c83b4 and a11893b.

📒 Files selected for processing (1)
  • scripts/windows/openclaude-aliases.ps1

Comment thread scripts/windows/openclaude-aliases.ps1

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the previously discussed paths and found one issue that still needs to be addressed.

Findings

  • [P2] Align the Windows helper docs with the shipped aliases
    docs/windows-aliases-and-launchers.md:47
    The new Windows aliases page still describes the old profile-initialization flow: oc-init is documented as saving and launching with a provider profile, and the daily commands advertise oc-provider -Provider ollama -Goal coding, -Model, and -ApiKey examples. The shipped helper no longer implements those surfaces: oc-init only pulls/checks Ollama and calls oc-local, while oc-provider has no parameters and just runs openclaude "/provider"; running the documented oc-provider -Provider ollama -Goal coding command fails with A parameter cannot be found that matches parameter name 'Provider'. Please update the docs to match the installed-CLI/env-invocation behavior, or restore the documented provider-profile command parameters.

@l28bit

l28bit commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the follow-up. I addressed the remaining docs/package alignment issue you called out.

The Windows aliases documentation now matches the shipped helper behavior:

  • Removed the old provider-profile initialization language from oc-init.
  • Removed examples for unsupported oc-provider parameter usage.
  • Documented that oc-provider opens the provider manager through the installed CLI.
  • Documented that oc-init pulls/checks the local Ollama model and then launches oc-local.
  • Documented that oc-local and oc-fast scope their environment overrides to a single invocation.
  • Documented that the helper is global-install oriented and uses the installed CLI instead of source-checkout development scripts.
  • Removed the previously added source TypeScript helper scripts from the package whitelist since the shipped helper no longer depends on them.

Validation performed:

  • Confirmed the docs no longer reference the removed oc-provider -Provider ... command shape.
  • Restored Bun on PATH in the current PowerShell session for validation.
  • npm pack --dry-run
  • Confirmed the package includes docs/windows-aliases-and-launchers.md
  • Confirmed the package includes scripts/windows/openclaude-aliases.ps1
  • Confirmed the package no longer includes the source TypeScript helper scripts previously added for the old approach.
  • bun run build
  • bun run smoke0.16.1 (OpenClaude)
  • node --check vscode-extension/openclaude-vscode/src/extension.js

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the previously discussed paths and do not see any remaining actionable issues from my side.

@kevincodex1 lgtm

@kevincodex1 kevincodex1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevincodex1 kevincodex1 merged commit 07c1c56 into Gitlawb:main Jun 8, 2026
3 checks passed
deagwon97 pushed a commit to deagwon97/openclaude that referenced this pull request Jun 11, 2026
* Enhance OpenClaude VS Code extension with Microsoft Foundry / Azure OpenAI support. Added configuration options for Azure API key, endpoint, and deployment settings. Updated README and documentation for new features, including a setup wizard for Azure integration. Improved terminal launch environment handling for Azure compatibility.

* Fix packaged Windows helper runtime references

* Use installed CLI from Windows helper aliases

* Scope Windows helper env overrides to invocation

* Align Windows alias docs with shipped helper
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.

3 participants