Skip to content

feat(headless): configure custom models through environment variables - #254

Open
kingsword09 wants to merge 1 commit into
mainfrom
feat/headless-model-env
Open

kingsword09 wants to merge 1 commit into
mainfrom
feat/headless-model-env

Conversation

@kingsword09

Copy link
Copy Markdown
Owner

Summary

  • Add headless environment configuration via ZCODE_MODEL_BASE_URL, ZCODE_API_KEY, ZCODE_MODEL, ZCODE_EFFORT, and ZCODE_API_TYPE.
  • Support Chat Completions, Responses, and Anthropic Messages protocol presets, preserving raw model IDs (including /) and CLI argument precedence.
  • Use a private per-run provider file without overwriting saved providers or account credentials; remove temporary credentials on success, failure, and handled cancellation.
  • Preserve the existing ZCODE_BASE_URL account-service meaning, skip legacy provider migration for custom-endpoint runs, and fail on incomplete configuration without falling back.
  • Document CI configuration, a GitHub Actions example, protocol mappings, and credential/security limitations in the README and configuration/headless guides.

Validation

  • bun run build:launcher
  • bun run test:unit — 84 passed before the final additional validation test; all 11 environment unit tests passed in the final targeted run.
  • bun test test/prompt-environment.test.ts test/runtime/prompt-environment.test.ts — 21 passed.
  • bun test test/runtime/prompt-environment.test.ts test/runtime/launcher.test.ts test/runtime/session-model-recovery.test.ts test/runtime/settings-file.test.ts — 18 passed before the final additional invalid-environment test.
  • bun test test/runtime/network-retry.test.ts test/runtime/app-server-auth.test.ts — 14 passed.
  • bun run typecheck
  • git diff --check
  • Parsed the documented GitHub Actions workflow as YAML.

Scope and limitations

  • Applies to --prompt / -p; does not change TUI, login, doctor, plugin commands, or app-server configuration.
  • Custom-provider effort mappings are protocol presets; the endpoint validates model support. Omitted effort or auto sends no explicit reasoning parameters.
  • Temporary provider files are not credential isolation or ephemeral sessions. Untrusted code executed by tools may access credentials; SIGKILL/runner loss cannot guarantee cleanup.
  • No dedicated GitHub Action or GitHub App is introduced; the documented workflow invokes the CLI directly.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

pkg-pr-new preview for commit 4bb9860199571c5fe1e4f72696a21e8f2164d10b.

npx --yes https://pkg.pr.new/zcode-app-cli@4bb9860

Full repository URL

This preview uses the selected commit. PR updates publish automatically after CI succeeds; kingsword09 can also request a preview with /pkg-pr-new.

Workflow logs

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