ready. Connect supports automatic setup.
Connect Qwen Code
Have Qwen Code installed, a workspace API key, and available RunInfra credits. The adapter targets Qwen Code 0.23.0 settings.What Connect writes
An absolute
QWEN_HOME replaces the .qwen directory directly. Connect writes settings.json inside it and refuses a relative override.
Connect adds catalog entries to the modelProviders.openai array. It sets security.auth.selectedType to openai, model.name to the selected slug, and model.baseUrl to https://api.runinfra.ai/v1. Entries include catalog context and output limits. Unrelated provider entries and supported comments are preserved.
Existing RunInfra models absent from the current catalog remain unchanged. Review them before selecting a model.
Key placement
By default, each managed model’senvKey names RUNINFRA_API_KEY. Literal mode stores the key once under env.RUNINFRA_API_KEY in settings.json.
For an environment handoff:
envKey reference. Set RUNINFRA_API_KEY securely in the environment that launches Qwen Code; Connect does not write the key to settings.env in helper mode. Connect does not edit dotenv files or trust settings.
If a retained provider entry still references an older credential variable, its saved assignment is kept unchanged. Review retained entries when replacing credentials.
Restart GUI apps and background services with the required environment. On Windows, set RUNINFRA_API_KEY in the user environment and fully restart the app. A GUI or Start menu launch does not inherit a terminal-only assignment.
A nonempty process environment takes precedence over discovered dotenv files, which take precedence over settings.env. Dotenv discovery walks from the current directory, preferring .qwen/.env over .env at each level, then checks home. When security.folderTrust.enabled is set, project dotenv candidates require a trusted workspace. Environment-name filters also apply; RUNINFRA_API_KEY passes the verified filters.
Verify
Qwen Code 0.23.0 produced a verified headless response through RunInfra with-p ... --output-format json, using the Connect-written settings.json.
This manual verification template is docs-only. Connect does not execute it:
Restart
Restart Qwen Code fully so the provider, selected model and credentials load together.Troubleshooting
New or empty files receive numeric$version: 4. Without that version, Qwen can rewrite settings during startup. Connect refuses nonempty unversioned files and unsupported versions; review and migrate those settings in Qwen before connecting. Duplicate keys and trailing commas are not supported by this adapter.
When workspace .qwen/settings.json or system settings define modelProviders or providerProtocol, they replace the corresponding user block as a whole rather than merging entries. Preserving an entry in your user file does not guarantee it remains visible.
Connect refuses an active
QWEN_CODE_SYSTEM_SETTINGS_PATH override. It also refuses a conflicting launch credential or a target credential variable shared by another provider. Resolve those conflicts before reconnecting.
Runtime snapshots, startup migrations, and selection saves can rewrite files or retain secrets. Keep those copies private and verify restoration on your installed version. Restoring Connect’s managed file does not restore or remove external copies.
Revert
off restores the original bytes from before the first on in the active connection. If the file did not exist then, Connect removes it. Later on calls and key rotations keep that restore point.
If Qwen or another editor changed the file, Connect refuses to overwrite it. Back up and review the edits before choosing to discard them:
Related
Connect
Set up, inspect, and restore your coding agent.
Chat completions
Read the request contract.
Models
Find model ids and context windows.