Repository navigation
Add Azure OpenAI and Claude in Foundry presets with the resource and deployment asked at sign-in - #175
Merged
Conversation
freehand login bedrock reaches Claude through Bedrock's Anthropic Messages
endpoint and freehand login bedrock-openai its OpenAI-compatible Chat
Completions endpoint, both with one Bedrock API key saved under
AWS_BEARER_TOKEN_BEDROCK. A preset's address may name {region}: the CLI
(--region, AWS_REGION), the terminal sign-in and the browser's Models
settings ask for it, and connections in any region are recognized as the
service. Refs #98.
…deployment asked at sign-in
freehand login azure reaches Azure OpenAI's v1 Responses API and
freehand login azure-claude Claude in Microsoft Foundry, each with an
API key under the variable its vendor's SDK reads. The places a preset's
address leaves open ({region}, {resource}) are now one mechanism, each
with a pattern that keeps the address on the service's host; Azure
presets also ask for the deployment the model is called by, in the CLI
(--resource, --deployment), the terminal sign-in and the browser.
|
Thanks for the pull request! A few friendly reminders based on the files changed:
(This comment updates automatically when you edit the PR description or push new commits.) |
4 of 5 tasks
Zezi Zeng (ClarenceStark)
changed the base branch from
feat/bedrock-preset
to
main
December 5, 2026 16:11
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.
Linked issue
Follows #173 (Amazon Bedrock), which this builds on: the base is
feat/bedrock-preset, so the diff shows only theAzure change. Once #173 is merged this will be rebased onto
main. No prior issue: Azure was asked for alongsideBedrock.
What changed (Before / After)
freehand login azure: Azure OpenAI through the v1 Responses API(
https://{resource}.openai.azure.com/openai/v1, the address Microsoft's v1 docs give for the OpenAI SDK),key
AZURE_OPENAI_API_KEY.freehand login azure-claude: Claude in Microsoft Foundry through Anthropic Messages(
https://{resource}.services.ai.azure.com/anthropic, the base URL the Anthropic SDK's Foundry client uses),key
ANTHROPIC_FOUNDRY_API_KEY.(
--resource,--deployment, the terminal sign-in, the browser's Models settings). The preset's model is only thename offered first.
session.PLACES:{region}from Add Amazon Bedrock service presets with a region asked at sign-in #173 and{resource}), each with a pattern that keeps the address on the service's host. Without a resource nothing issaved, and the browser refuses an address left open.
against Azure's v1 API) and uses WebSocket mode only on api.openai.com; Foundry's Messages endpoint authenticates
with
x-api-key, as the Anthropic provider sends it.Out of scope: Microsoft Entra ID sign-in, other Foundry models (DeepSeek, Grok) as presets.
Visual proof (UI / TUI / Web / Desktop / export changes)
Browser, Settings → Models (clean temporary
FREEHAND_HOME): "Azure OpenAI" and "Azure Foundry Claude" tiles; theform asks for Resource, Deployment (prefilled with the default model) and API key. CLI:
How you verified it
tests/test_azure.py: CLI login for both presets, malformed or missing resources save nothing, servicerecognition (and OpenAI's own address is still OpenAI), the browser presets and the open-address guard, the legacy
key endpoint refuses before writing, and against fake servers the request path, auth header and deployment name.
tests/test_terminal.py).tests/test_web_e2e.py).AI disclosure & checklist
uv run pyflakes src tests .github/scriptsprints nothing and relevant tests pass locally (full suite runs in CI)CHANGELOG.mduntouched: added an "Added" line under Unreleased, as AGENTS.md askssrc/freehand/runtime/still uses only the standard library and imports on Python 3.9 (untouched)