bloom-launch 0.3.1__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/.github/workflows/release.yml +2 -2
  2. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/PKG-INFO +11 -8
  3. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/README.md +10 -7
  4. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/adapter-contract.md +6 -1
  5. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/alpha-release-contract.md +8 -8
  6. bloom_launch-0.4.0/docs/code-harness-compatibility/opencode-2.3.2.md +65 -0
  7. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/installation.md +8 -8
  8. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/quick-launch.md +1 -1
  9. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/pyproject.toml +1 -1
  10. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/scripts/check_artifacts.py +1 -1
  11. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/scripts/verify_release_candidate.py +2 -2
  12. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/launch.py +40 -5
  13. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/wrappers.py +29 -3
  14. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/installed_connection_probe.py +4 -0
  15. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/native_smoke_support.py +4 -1
  16. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_artifacts.py +2 -2
  17. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_cli_forwarding.py +3 -0
  18. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_model_limits.py +1 -0
  19. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_native_smoke.py +6 -2
  20. bloom_launch-0.4.0/tests/test_opencode_launch.py +180 -0
  21. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_release_workflow.py +5 -5
  22. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_secret_validation.py +1 -0
  23. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_thin_launch.py +4 -0
  24. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/thin_job_control_probe.py +1 -1
  25. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/uv.lock +1 -1
  26. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/.github/workflows/local-checks.yml +0 -0
  27. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/.gitignore +0 -0
  28. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/CONTEXT.md +0 -0
  29. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/LICENSE +0 -0
  30. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/adr/0001-authorization-is-not-qualification.md +0 -0
  31. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/adr/0002-persistent-native-profiles.md +0 -0
  32. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/adr/0003-credential-and-process-ownership.md +0 -0
  33. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/ci-efficiency-decisions.md +0 -0
  34. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/code-harness-compatibility/codex-0.167.2.md +0 -0
  35. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/code-harness-compatibility/copilot-1.0.112.md +0 -0
  36. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/connections.md +0 -0
  37. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/demo-goal.md +0 -0
  38. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/development.md +0 -0
  39. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/headless.md +0 -0
  40. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/local-testing.md +0 -0
  41. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/models.md +0 -0
  42. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/multi-harness-engineering-requirements.md +0 -0
  43. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/opencode-bootstrap-compatibility.md +0 -0
  44. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/opencode-demo.md +0 -0
  45. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/qualification.md +0 -0
  46. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/releasing.md +0 -0
  47. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-04-ci-efficiency.md +0 -0
  48. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-04-coderabbit-followup.md +0 -0
  49. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-05-demo-goal.md +0 -0
  50. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-05-opencode-demo.md +0 -0
  51. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-11-agent-id.md +0 -0
  52. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-12-agent-id-default.md +0 -0
  53. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-12-codex-launch-spike.md +0 -0
  54. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/plans/2026-11-12-session-id.md +0 -0
  55. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/specs/2026-11-04-ci-efficiency-design.md +0 -0
  56. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/specs/2026-11-04-coderabbit-followup-design.md +0 -0
  57. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/specs/2026-11-05-demo-goal-design.md +0 -0
  58. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/docs/superpowers/specs/2026-11-05-opencode-demo-design.md +0 -0
  59. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/scripts/check_local_install.sh +0 -0
  60. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/scripts/diagnose_discovery.py +0 -0
  61. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/__init__.py +0 -0
  62. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/__main__.py +0 -0
  63. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/cli.py +0 -0
  64. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/contract.py +0 -0
  65. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/discovery.py +0 -0
  66. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/labels.py +0 -0
  67. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/model_metadata.py +0 -0
  68. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/process.py +0 -0
  69. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/progress.py +0 -0
  70. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/settings.py +0 -0
  71. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/src/bloom_cli/urls.py +0 -0
  72. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/conftest.py +0 -0
  73. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/job_control.py +0 -0
  74. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/job_control_probe.py +0 -0
  75. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/pty_driver.py +0 -0
  76. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_ci_workflow.py +0 -0
  77. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_codex_compatibility.py +0 -0
  78. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_codex_launch.py +0 -0
  79. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_copilot_launch.py +0 -0
  80. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_discovery_diagnostic.py +0 -0
  81. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_install_script.py +0 -0
  82. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_installed_launch.py +0 -0
  83. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_job_control.py +0 -0
  84. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_launch_progress.py +0 -0
  85. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_model_labels.py +0 -0
  86. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_model_metadata.py +0 -0
  87. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_process.py +0 -0
  88. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_progress.py +0 -0
  89. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_show_config.py +0 -0
  90. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_urls.py +0 -0
  91. {bloom_launch-0.3.1 → bloom_launch-0.4.0}/tests/test_wrappers.py +0 -0
@@ -76,7 +76,7 @@ jobs:
76
76
 
77
77
  root = Path(os.environ["CANDIDATE_DIR"])
78
78
  dist = root / "dist"
79
- names = {"bloom_launch-0.3.1-py3-none-any.whl", "bloom_launch-0.3.1.tar.gz"}
79
+ names = {"bloom_launch-0.4.0-py3-none-any.whl", "bloom_launch-0.4.0.tar.gz"}
80
80
  if (dist.is_symlink() or not dist.is_dir()
81
81
  or {p.name for p in root.iterdir()} != {"dist"}
82
82
  or {p.name for p in dist.iterdir()} != names
@@ -144,7 +144,7 @@ jobs:
144
144
  trusted = Path(os.environ["GITHUB_WORKSPACE"]) / "trusted"
145
145
  root = Path(os.environ["RUNNER_TEMP"]) / "bloom-release-candidate"
146
146
  verifier = runpy.run_path(str(trusted / "scripts/verify_release_candidate.py"))
147
- names = ("bloom_launch-0.3.1-py3-none-any.whl", "bloom_launch-0.3.1.tar.gz")
147
+ names = ("bloom_launch-0.4.0-py3-none-any.whl", "bloom_launch-0.4.0.tar.gz")
148
148
  expected = {
149
149
  "source_sha": os.environ["TRUSTED_WORKFLOW_SHA"],
150
150
  "repository": os.environ["GITHUB_REPOSITORY"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bloom-launch
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: Scoped launcher for native coding harnesses
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -22,25 +22,25 @@ Plain `claude`, `codex`, `copilot`, or `opencode` continues to use its normal co
22
22
 
23
23
  ## Install
24
24
 
25
- Requirements: Python **3.12 or later**, plus Claude Code, Codex CLI `0.167.2`, GitHub Copilot CLI `1.0.112+` (`1.x`), or OpenCode already installed and available on `PATH`.
25
+ Requirements: Python **3.12 or later**, plus Claude Code, Codex CLI `0.167.2`, GitHub Copilot CLI `1.0.112+` (`1.x`), or OpenCode `1.x` or `2.3.2+` (`2.x`) already installed and available on `PATH`.
26
26
  macOS is the primary platform. Bloom does not install or repair your Coding Harness.
27
27
  Codex and Copilot have structural adapter evidence only. Live Bloom, tool/history, and full interactive qualification remain unrecorded.
28
28
  The bundled Codex and Copilot commands do not establish a Qualified Harness Path or satisfy the release's native acceptance gate.
29
29
  Before launching, follow the [Claude Code installation instructions](https://docs.anthropic.com/en/docs/claude-code/overview), [Codex CLI installation instructions](https://developers.openai.com/codex/), [GitHub Copilot CLI installation instructions](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli), or [OpenCode installation instructions](https://opencode.ai/docs/installation/).
30
30
 
31
- These instructions describe `0.3.1`; if not yet available on PyPI, collaborators can use a source checkout.
32
- The selected source version is `0.3.1`.
31
+ These instructions describe `0.4.0`; if not yet available on PyPI, collaborators can use a source checkout.
32
+ The selected source version is `0.4.0`.
33
33
 
34
34
  When available on PyPI, install this exact version with either tool:
35
35
 
36
36
  ```sh
37
- uv tool install 'bloom-launch==0.3.1'
37
+ uv tool install 'bloom-launch==0.4.0'
38
38
  # Or:
39
- pipx install 'bloom-launch==0.3.1'
39
+ pipx install 'bloom-launch==0.4.0'
40
40
  ```
41
41
 
42
42
  Collaborators need access to the private [repository](https://github.com/Bloom-Factory-Engineering/bloom-cli) for a source checkout.
43
- Use a checkout whose project metadata and lockfile both specify `0.3.1` before running:
43
+ Use a checkout whose project metadata and lockfile both specify `0.4.0` before running:
44
44
 
45
45
  ```sh
46
46
  uv sync --locked --group dev
@@ -91,7 +91,7 @@ Use `--` when you want to mark the start of native arguments clearly. Bloom send
91
91
  bloom launch claude -- --verbose
92
92
  ```
93
93
 
94
- Bloom keeps `--model` for its own gateway model selection. Bloom also keeps Claude Code's `--settings` option for its private settings file.
94
+ Bloom keeps `--model` for its own gateway model selection. Bloom also keeps Claude Code's `--settings` option for its private settings file, and OpenCode's `-m`, `--server`, and `--standalone` options.
95
95
 
96
96
  | Argument | Purpose |
97
97
  | --- | --- |
@@ -118,6 +118,9 @@ Ordinary launches use the cached vkey and the harness's saved model for direct n
118
118
  First setup, `--config`, and explicit `--model` perform discovery and access checks before handoff.
119
119
  Each normalized gateway shares one vkey across all four harnesses. Each harness has a separate model default.
120
120
  Copilot CLI `1.0.112` or later `1.x` is required. It sends agent and session headers through `COPILOT_PROVIDER_HEADERS`. Versions newer than the tested `1.0.x` line print a warning and continue.
121
+ OpenCode `1.x` or `2.3.2` or later `2.x` is required. Bloom checks `opencode --version` before launch.
122
+ On OpenCode `2.x`, Bloom adds `--standalone`, so the launch uses a private OpenCode server. It does not use or change the shared OpenCode background service, and plain `opencode` keeps its normal connection.
123
+ OpenCode commands that cannot use a private server (for example `service`, `serve`, `pair`, `upgrade`, or `acp`) stop with an `Unrecognized flag: --standalone` error. Run them with plain `opencode`.
121
124
 
122
125
  `--config` prompts for a replacement vkey, displays model choices, and prompts for an agent ID.
123
126
  Bloom saves the vkey, agent ID, and current harness's model atomically after discovery, selection, and native preparation succeed.
@@ -7,25 +7,25 @@ Plain `claude`, `codex`, `copilot`, or `opencode` continues to use its normal co
7
7
 
8
8
  ## Install
9
9
 
10
- Requirements: Python **3.12 or later**, plus Claude Code, Codex CLI `0.167.2`, GitHub Copilot CLI `1.0.112+` (`1.x`), or OpenCode already installed and available on `PATH`.
10
+ Requirements: Python **3.12 or later**, plus Claude Code, Codex CLI `0.167.2`, GitHub Copilot CLI `1.0.112+` (`1.x`), or OpenCode `1.x` or `2.3.2+` (`2.x`) already installed and available on `PATH`.
11
11
  macOS is the primary platform. Bloom does not install or repair your Coding Harness.
12
12
  Codex and Copilot have structural adapter evidence only. Live Bloom, tool/history, and full interactive qualification remain unrecorded.
13
13
  The bundled Codex and Copilot commands do not establish a Qualified Harness Path or satisfy the release's native acceptance gate.
14
14
  Before launching, follow the [Claude Code installation instructions](https://docs.anthropic.com/en/docs/claude-code/overview), [Codex CLI installation instructions](https://developers.openai.com/codex/), [GitHub Copilot CLI installation instructions](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli), or [OpenCode installation instructions](https://opencode.ai/docs/installation/).
15
15
 
16
- These instructions describe `0.3.1`; if not yet available on PyPI, collaborators can use a source checkout.
17
- The selected source version is `0.3.1`.
16
+ These instructions describe `0.4.0`; if not yet available on PyPI, collaborators can use a source checkout.
17
+ The selected source version is `0.4.0`.
18
18
 
19
19
  When available on PyPI, install this exact version with either tool:
20
20
 
21
21
  ```sh
22
- uv tool install 'bloom-launch==0.3.1'
22
+ uv tool install 'bloom-launch==0.4.0'
23
23
  # Or:
24
- pipx install 'bloom-launch==0.3.1'
24
+ pipx install 'bloom-launch==0.4.0'
25
25
  ```
26
26
 
27
27
  Collaborators need access to the private [repository](https://github.com/Bloom-Factory-Engineering/bloom-cli) for a source checkout.
28
- Use a checkout whose project metadata and lockfile both specify `0.3.1` before running:
28
+ Use a checkout whose project metadata and lockfile both specify `0.4.0` before running:
29
29
 
30
30
  ```sh
31
31
  uv sync --locked --group dev
@@ -76,7 +76,7 @@ Use `--` when you want to mark the start of native arguments clearly. Bloom send
76
76
  bloom launch claude -- --verbose
77
77
  ```
78
78
 
79
- Bloom keeps `--model` for its own gateway model selection. Bloom also keeps Claude Code's `--settings` option for its private settings file.
79
+ Bloom keeps `--model` for its own gateway model selection. Bloom also keeps Claude Code's `--settings` option for its private settings file, and OpenCode's `-m`, `--server`, and `--standalone` options.
80
80
 
81
81
  | Argument | Purpose |
82
82
  | --- | --- |
@@ -103,6 +103,9 @@ Ordinary launches use the cached vkey and the harness's saved model for direct n
103
103
  First setup, `--config`, and explicit `--model` perform discovery and access checks before handoff.
104
104
  Each normalized gateway shares one vkey across all four harnesses. Each harness has a separate model default.
105
105
  Copilot CLI `1.0.112` or later `1.x` is required. It sends agent and session headers through `COPILOT_PROVIDER_HEADERS`. Versions newer than the tested `1.0.x` line print a warning and continue.
106
+ OpenCode `1.x` or `2.3.2` or later `2.x` is required. Bloom checks `opencode --version` before launch.
107
+ On OpenCode `2.x`, Bloom adds `--standalone`, so the launch uses a private OpenCode server. It does not use or change the shared OpenCode background service, and plain `opencode` keeps its normal connection.
108
+ OpenCode commands that cannot use a private server (for example `service`, `serve`, `pair`, `upgrade`, or `acp`) stop with an `Unrecognized flag: --standalone` error. Run them with plain `opencode`.
106
109
 
107
110
  `--config` prompts for a replacement vkey, displays model choices, and prompts for an agent ID.
108
111
  Bloom saves the vkey, agent ID, and current harness's model atomically after discovery, selection, and native preparation succeed.
@@ -15,8 +15,13 @@ UUID prefix removal affects picker labels only. Wrappers receive exact model IDs
15
15
  No qualification registry, native assessment, or separate candidate route remains.
16
16
 
17
17
  Claude uses a private settings overlay with endpoint, bearer, cleared competing connection inputs, and model defaults.
18
- OpenCode uses `OPENCODE_CONFIG_CONTENT`, provider `bloom`, `/v1`, and the exact native selector `bloom/EXACT_ID`.
18
+ OpenCode uses `OPENCODE_CONFIG_CONTENT`, provider `bloom`, `/v1`, and the exact native selector `bloom/EXACT_ID` as `model` and `small_model`.
19
19
  The OpenCode wrapper preserves unrelated inherited inline JSON fields and nested siblings.
20
+ `launch.py` checks `opencode --version`. OpenCode `1.x` starts as `--model bloom/EXACT_ID`.
21
+ OpenCode `2.3.2` or later `2.x` has no root `--model` and reads inline configuration in its server, so it starts with `--standalone` and takes the model from inline configuration.
22
+ Without `--standalone`, OpenCode 2.x would use the shared background service, which never sees the child-only configuration, or start one that keeps it, including the vkey.
23
+ Bloom adds `--standalone=true` to every OpenCode 2.x launch. The explicit value matters: a bare `--standalone` takes a following `false`, `0`, `no`, or `off` (for example a directory name) as its value. Commands that reject it (for example `service`, `serve`, `pair`, `upgrade`, `acp`) stop at OpenCode's flag check before they run, so the inline credentials never reach them.
24
+ See [OpenCode 2.3.2 compatibility](code-harness-compatibility/opencode-2.3.2.md).
20
25
  The native harness owns every other configuration source, plugin, permission, and history entry.
21
26
 
22
27
  Before handoff, the wrapper or caller cleans an abandoned plan.
@@ -1,9 +1,9 @@
1
- # `0.3.1` macOS-first public release contract
1
+ # `0.4.0` macOS-first public release contract
2
2
 
3
- This contract describes the selected `bloom-launch==0.3.1` release, with command `bloom` and Python 3.12 or later.
3
+ This contract describes the selected `bloom-launch==0.4.0` release, with command `bloom` and Python 3.12 or later.
4
4
  It retains the macOS-first boundary and separate release gates. It does not grant new publication approval or establish production readiness.
5
5
  The earlier `0.1.0a4` release-preparation check is historical. Publication of
6
- `0.3.1` remains a separate owner-authorized action.
6
+ `0.4.0` remains a separate owner-authorized action.
7
7
 
8
8
  ## HISTORICAL: `0.1.0a1` and `0.1.0a4` approvals
9
9
 
@@ -88,8 +88,8 @@ Personal-store access still requires separate authority. Synthetic checks use th
88
88
  ## Package and publication gates
89
89
 
90
90
  - Retain Apache-2.0. Include the license text and package license metadata.
91
- - Align distribution `bloom-launch`, selected version `0.3.1`, command `bloom`, and Python requirement `>=3.12` throughout the candidate.
92
- - Require the owner-supplied root package version update in `uv.lock` to `0.3.1` as part of the coordinated source commit.
91
+ - Align distribution `bloom-launch`, selected version `0.4.0`, command `bloom`, and Python requirement `>=3.12` throughout the candidate.
92
+ - Require the owner-authorized root package version update in `uv.lock` to `0.4.0` as part of the coordinated source commit.
93
93
  - Agents must not edit `uv.lock`. Preserve every dependency entry and the repository's lockfile prohibition.
94
94
  - Do not reuse the historical `0.1.0` to `0.1.0a1` lockfile exception for this candidate.
95
95
  - Confirm the owner step before claiming locked readiness. Preserve locked validation and subsequent lockfile immutability.
@@ -112,8 +112,8 @@ Personal-store access still requires separate authority. Synthetic checks use th
112
112
  - After publication, install the exact version from PyPI outside the checkout in a fresh isolated environment.
113
113
  - Verify version, help, and the agreed installed journey against that PyPI installation.
114
114
 
115
- The owner-supplied root lockfile version matches the project at `0.3.1`, with no dependency-entry changes.
116
- Fresh locked installation passed and the installed source command reports `0.3.1`.
115
+ The owner-authorized root lockfile version matches the project at `0.4.0`, with no dependency-entry changes.
116
+ Fresh locked installation passed and the installed source command reports `0.4.0`.
117
117
  Current artifacts remain provisional until exact-source, acceptance, scan, hash-approval, and publication gates pass.
118
118
  Historical license and source-distribution approvals do not supply exact-candidate upload approval.
119
119
  Original-native execution, paid calls, personal-store access, and repository-visibility changes retain their separate authority requirements.
@@ -134,7 +134,7 @@ The trusted checkout and candidate data have separate paths. The scanner never i
134
134
  Only its scan step receives `BLOOM_RELEASE_FORBIDDEN_TERMS`.
135
135
  Missing or invalid policy, or an unprotected trusted ref, fails closed before a checked candidate can be retained.
136
136
  Successful scanning preserves source/wheel/sdist parity, the exact distribution bytes, and the unchanged receipt.
137
- The artifact contains `manifest.json`, `dist/bloom_launch-0.3.1-py3-none-any.whl`, and `dist/bloom_launch-0.3.1.tar.gz`.
137
+ The artifact contains `manifest.json`, `dist/bloom_launch-0.4.0-py3-none-any.whl`, and `dist/bloom_launch-0.4.0.tar.gz`.
138
138
  This workflow does not trigger a PyPI upload, tag, merge, or service deployment.
139
139
 
140
140
  Administrator setup remains TBD and blocks release.
@@ -0,0 +1,65 @@
1
+ # OpenCode 2.3.2 Compatibility Evidence
2
+
3
+ Status: loopback adapter evidence and one live staging `run` recorded on 2026-11-19. This is not full interactive qualification.
4
+
5
+ ## Baseline
6
+
7
+ - Executable: `opencode` (Homebrew stable)
8
+ - Reported version: `opencode v2.3.2`
9
+ - Host: macOS Apple Silicon
10
+ - Tested native surfaces: the interactive TUI (no subcommand) and `run`
11
+
12
+ ## Changes From OpenCode 1.x
13
+
14
+ - The root command has no `--model` option. `opencode --model ...` stops with `Unrecognized flag: --model in command opencode`. Only `run` and `mini` accept `--model`/`-m`.
15
+ - OpenCode is client/server. By default the TUI and `run` connect to a shared background service (`opencode serve --service`, discovered through `$XDG_STATE_HOME/opencode/service.json`) or start one.
16
+ - The server reads `OPENCODE_CONFIG_CONTENT`. A running background service never sees the child-only value, and a service started by the launch could keep it after the launch ends.
17
+ - `--standalone` runs a private server for that invocation. It starts `opencode serve --stdio --port 0` as a child that listens on a loopback port and inherits the child environment.
18
+ - `--standalone` is a boolean flag. A bare `--standalone` takes a following `false`, `0`, `no`, or `off` as its value; `opencode --standalone false debug config` used the shared service. `--standalone=true` keeps the next word as a normal argument. A second `--standalone` or `--no-standalone` stops with `Invalid value for flag --standalone: "2 occurrences"`.
19
+ - Support for `--standalone` is per leaf command. The root command, `run`, `mini`, `models`, `stats`, `api`, `reload`, every `session` and `auth` command, `debug agents`, `debug config`, `mcp list`/`auth`/`logout`, and `plugin list`/`check`/`update` accept it. `upgrade`/`update`, `uninstall`, `acp`, `pair`, `serve`, every `service` command, `debug heap-dump`/`paths`, `mcp add`, and `plugin add`/`remove` reject it at flag parsing, before the command runs.
20
+ - Without `--standalone`, a command that needs a server starts the shared service when none is running. `service start`, `debug config`, `pair`, and `models` each started a detached `opencode serve --service` (parent pid 1) whose environment held the caller's `OPENCODE_CONFIG_CONTENT`. That process outlives the caller.
21
+ - OpenCode 1.x configuration fields are still accepted. `provider`, `model`, and `small_model` keep working. `small_model` becomes the title agent's model.
22
+ - Inline configuration is merged after global, `OPENCODE_CONFIG`, and project configuration, and before managed system preferences. It overrides a personal or project `model`.
23
+ - The TUI picks its model in this order: CLI argument, the last configuration document with `model`, then recent models.
24
+ - `@ai-sdk/openai-compatible` is built in. No package download is needed.
25
+
26
+ ## Adapter Mapping
27
+
28
+ `launch.py` runs `opencode --version` before any vkey prompt:
29
+
30
+ - `1.x`: argv prefix `--model bloom/<selected Bloom model>` (unchanged from earlier releases).
31
+ - `2.3.2` or later `2.x`: argv prefix `--standalone=true` for every command. Commands that reject the flag stop with `Unrecognized flag: --standalone` before they run, so Bloom's inline credentials never reach a shared service.
32
+ - Empty or unparsable output, `0.x` (including `0.0.0-<channel>-<n>` preview builds), `2.x` below `2.3.2` (including `2.3.2` prereleases such as `2.3.2-rc.1`), and other majors: refuse.
33
+
34
+ The inline configuration is the same for both majors:
35
+
36
+ ```text
37
+ OPENCODE_CONFIG_CONTENT = inherited inline JSON plus
38
+ model = small_model = "bloom/<selected Bloom model>"
39
+ provider.bloom.npm = "@ai-sdk/openai-compatible"
40
+ provider.bloom.options.baseURL = "<Bloom base URL>/v1"
41
+ provider.bloom.options.apiKey = <selected Bloom vkey>
42
+ provider.bloom.options.headers = X-Bloom-Agent-ID / X-Bloom-Session-ID when set
43
+ provider.bloom.models["<selected Bloom model>"]
44
+ ```
45
+
46
+ ## Native Argument Policy
47
+
48
+ The adapter forwards other native arguments in their original order. It reserves:
49
+
50
+ - `--model` and `-m`, which would select another model
51
+ - `--server`, which would connect to another server instead of the private one
52
+ - `--standalone`, which Bloom already adds
53
+
54
+ ## Evidence
55
+
56
+ - Sandboxed loopback probe (`tests/test_native_smoke.py`, isolated HOME/XDG, fake vkey): `opencode --standalone run` exited `0` and sent two `POST /v1/chat/completions` requests with the selected model and `Authorization: Bearer <fake vkey>`. Project instructions were loaded, an inherited inline `bash` deny removed the `bash` tool, and a personal `model` in the global configuration was overridden.
57
+ - TUI through `bloom launch opencode` in a PTY against a loopback recorder: OpenCode started without a flag error, and the typed prompt reached `POST /v1/chat/completions` with the selected model, the fake vkey, and `X-Bloom-Agent-ID`.
58
+ - Live `run` against `https://stage-gateway.bloomfactory.ai` with an allowed Anthropic model returned a normal answer.
59
+ - The shared background service kept the same process and an unchanged `service.json` during every check. No new background service was started.
60
+
61
+ ## Limits
62
+
63
+ - A continued session keeps its earlier model. `bloom launch opencode run --continue` on a session created with another provider sent the request to that provider, not to Bloom. The TUI's `--continue` and `--session` behave the same way. On `run` and `mini`, adding `--model bloom/<id>` routed the continued session to Bloom.
64
+ - OpenCode 1.x was not re-tested for this change. Its argv is unchanged.
65
+ - The sandboxed probe needs loopback inbound access, because the private server listens on a loopback port.
@@ -3,32 +3,32 @@
3
3
  ## Requirements
4
4
 
5
5
  - Python 3.12 or later.
6
- - Claude Code, Codex CLI `0.167.2`, or OpenCode already installed and available on `PATH`.
6
+ - Claude Code, Codex CLI `0.167.2`, or OpenCode `1.x` or `2.3.2+` (`2.x`) already installed and available on `PATH`.
7
7
  - An interactive terminal for hidden vkey input during setup.
8
8
 
9
9
  macOS is the primary platform. Bloom does not install, upgrade, or repair the Coding Harness.
10
10
  The Coding Harness retains its normal settings, permissions, plugins, and history.
11
11
  Install [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview), [Codex CLI](https://developers.openai.com/codex/), or [OpenCode](https://opencode.ai/docs/installation/) before using Bloom Launch.
12
12
 
13
- ## Install `0.3.1`
13
+ ## Install `0.4.0`
14
14
 
15
- These instructions describe `0.3.1`; if not yet available on PyPI, collaborators can use a source checkout.
15
+ These instructions describe `0.4.0`; if not yet available on PyPI, collaborators can use a source checkout.
16
16
  When available, choose either isolated installation tool:
17
17
 
18
18
  ```sh
19
- uv tool install 'bloom-launch==0.3.1'
19
+ uv tool install 'bloom-launch==0.4.0'
20
20
  # Or:
21
- pipx install 'bloom-launch==0.3.1'
21
+ pipx install 'bloom-launch==0.4.0'
22
22
  ```
23
23
 
24
- The selected source metadata is `0.3.1`. This does not establish publication or release approval.
24
+ The selected source metadata is `0.4.0`. This does not establish publication or release approval.
25
25
  The published `0.1.0a1` lacks the cached-vkey behavior described here.
26
26
  See its [historical PyPI instructions](https://pypi.org/project/bloom-launch/0.1.0a1/) for that version.
27
27
 
28
28
  ## Source checkout
29
29
 
30
30
  Collaborators need access to the private [repository](https://github.com/Bloom-Factory-Engineering/bloom-cli) to obtain a source checkout.
31
- Before using the commands below, confirm that project metadata and the owner-updated root lockfile both specify `0.3.1`.
31
+ Before using the commands below, confirm that project metadata and the owner-updated root lockfile both specify `0.4.0`.
32
32
  Agents must not edit `uv.lock` or bypass the locked install.
33
33
  Run from the checkout root:
34
34
 
@@ -43,7 +43,7 @@ uv run --no-sync bloom launch opencode
43
43
  ```
44
44
 
45
45
  In this checkout, prefix the documented `bloom` commands with `uv run --no-sync`.
46
- The source checkout implements the `0.3.1` behavior described in these documents.
46
+ The source checkout implements the `0.4.0` behavior described in these documents.
47
47
 
48
48
  ## Credentials and first launch
49
49
 
@@ -1,7 +1,7 @@
1
1
  # Launch behavior
2
2
 
3
3
  These instructions describe cached vkeys and configurable agent IDs.
4
- If `0.3.1` is not yet available on PyPI, collaborators can follow the [source-checkout installation](installation.md#source-checkout).
4
+ If `0.4.0` is not yet available on PyPI, collaborators can follow the [source-checkout installation](installation.md#source-checkout).
5
5
  In that checkout, use `uv run --no-sync bloom` instead of `bloom`.
6
6
 
7
7
  ## Commands
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bloom-launch"
7
- version = "0.3.1"
7
+ version = "0.4.0"
8
8
  description = "Scoped launcher for native coding harnesses"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -55,7 +55,7 @@ def safe_path(name):
55
55
  def validate(root, dist, terms):
56
56
  project = tomllib.loads((root / "pyproject.toml").read_text())["project"]
57
57
  name, version = project["name"], project["version"]
58
- require(name == "bloom-launch" and version == "0.3.1")
58
+ require(name == "bloom-launch" and version == "0.4.0")
59
59
  require(project["license"] == "Apache-2.0" and project["license-files"] == ["LICENSE"])
60
60
  license_bytes = (root / "LICENSE").read_bytes()
61
61
  readme_bytes = (root / project["readme"]).read_bytes()
@@ -6,8 +6,8 @@ import json
6
6
  import re
7
7
  from pathlib import Path
8
8
 
9
- WHEEL = "bloom_launch-0.3.1-py3-none-any.whl"
10
- SDIST = "bloom_launch-0.3.1.tar.gz"
9
+ WHEEL = "bloom_launch-0.4.0-py3-none-any.whl"
10
+ SDIST = "bloom_launch-0.4.0.tar.gz"
11
11
 
12
12
 
13
13
  def unique_fields(pairs):
@@ -9,7 +9,7 @@ import sys
9
9
  import warnings
10
10
  from collections import Counter
11
11
  from pathlib import Path
12
- from typing import cast
12
+ from typing import Literal, cast
13
13
 
14
14
  from .contract import AgentId, LaunchError, Secret, SelectedConnection
15
15
  from .discovery import connected_models
@@ -29,6 +29,8 @@ _DEFAULT_AGENT_IDS = {
29
29
  }
30
30
  _COPILOT_MIN_VERSION = (1, 0, 112)
31
31
  _COPILOT_MIN_VERSION_TEXT = ".".join(str(part) for part in _COPILOT_MIN_VERSION)
32
+ _OPENCODE_2_MIN_VERSION = (2, 3, 2)
33
+ _OPENCODE_SUPPORTED_TEXT = "OpenCode 1.x or 2.3.2 or later 2.x"
32
34
 
33
35
 
34
36
  def prompt_vkey() -> Secret:
@@ -95,6 +97,31 @@ def _validate_copilot_version(executable: Path) -> str | None:
95
97
  return None
96
98
 
97
99
 
100
+ def _validate_opencode_version(executable: Path) -> Literal[1, 2]:
101
+ """Return the OpenCode major version: 1.x, or 2.x from the tested 2.3.2 floor."""
102
+ try:
103
+ result = subprocess.run((str(executable), "--version"), capture_output=True,
104
+ text=True, check=True, timeout=5)
105
+ except (OSError, subprocess.SubprocessError):
106
+ raise LaunchError(
107
+ f"Cannot verify OpenCode version; install {_OPENCODE_SUPPORTED_TEXT}") from None
108
+ lines = [line.strip() for line in result.stdout.splitlines() if line.strip()]
109
+ match = re.fullmatch(
110
+ r"(?:opencode\s+)?v?(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?",
111
+ lines[0]) if lines else None
112
+ if match is None:
113
+ raise LaunchError(f"Unsupported OpenCode version; install {_OPENCODE_SUPPORTED_TEXT}")
114
+ version = tuple(int(part) for part in match.groups()[:3])
115
+ if version[0] == 1:
116
+ return 1
117
+ # A prerelease sorts before its release, so 2.3.2-rc.1 is below the 2.3.2 floor.
118
+ if version[0] == 2 and (*version, match[4] is None) >= (*_OPENCODE_2_MIN_VERSION, True):
119
+ return 2
120
+ version_text = ".".join(str(part) for part in version)
121
+ raise LaunchError(
122
+ f"Unsupported OpenCode version {version_text}; install {_OPENCODE_SUPPORTED_TEXT}")
123
+
124
+
98
125
  def launch(harness: str, *, base_url: str, model: str | None = None, reset: bool = False,
99
126
  agent_id: str | None = None, session_id: str | None = None,
100
127
  native_args: tuple[str, ...] = ()) -> int:
@@ -105,8 +132,11 @@ def launch(harness: str, *, base_url: str, model: str | None = None, reset: bool
105
132
  executable = shutil.which(harness, path=environment.get("PATH", os.defpath))
106
133
  if executable is None:
107
134
  raise LaunchError("Harness executable not found; install it and check PATH")
135
+ opencode_major: Literal[1, 2] = 2
108
136
  if harness == "codex":
109
137
  _validate_codex_version(Path(executable))
138
+ elif harness == "opencode":
139
+ opencode_major = _validate_opencode_version(Path(executable))
110
140
  elif harness == "copilot":
111
141
  warning = _validate_copilot_version(Path(executable))
112
142
  if warning is not None:
@@ -187,10 +217,15 @@ def launch(harness: str, *, base_url: str, model: str | None = None, reset: bool
187
217
  resolved_agent_id = AgentId(cast(str, resolved_agent_id), forbidden=vkey.value).value
188
218
  connection = SelectedConnection(base_url, selected, vkey, limits.get(selected),
189
219
  resolved_agent_id, direct_session_id)
190
- prepare = {"claude": prepare_claude, "codex": prepare_codex,
191
- "copilot": prepare_copilot, "opencode": prepare_opencode}[harness]
192
- plan = prepare(connection, executable=Path(executable).absolute(), cwd=cwd,
193
- environment=environment, native_args=native_args)
220
+ if harness == "opencode":
221
+ plan = prepare_opencode(connection, executable=Path(executable).absolute(), cwd=cwd,
222
+ environment=environment, native_args=native_args,
223
+ cli_major=opencode_major)
224
+ else:
225
+ prepare = {"claude": prepare_claude, "codex": prepare_codex,
226
+ "copilot": prepare_copilot}[harness]
227
+ plan = prepare(connection, executable=Path(executable).absolute(), cwd=cwd,
228
+ environment=environment, native_args=native_args)
194
229
  required_save = prompted or reset or not usable
195
230
  new_limit = fresh_limits.get(selected)
196
231
  try:
@@ -12,6 +12,7 @@ from collections.abc import Mapping
12
12
  from datetime import date, datetime, time
13
13
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
14
14
  from pathlib import Path
15
+ from typing import Literal
15
16
  from urllib.parse import urlunsplit
16
17
 
17
18
  from .contract import LaunchError, LaunchPlan, SelectedConnection
@@ -147,6 +148,8 @@ def validate_native_args(harness: str, native_args: tuple[str, ...]) -> None:
147
148
  reserved = {"--model"}
148
149
  if harness == "claude":
149
150
  reserved.add("--settings")
151
+ elif harness == "opencode":
152
+ reserved.update({"-m", "--server", "--standalone"})
150
153
  elif harness == "codex":
151
154
  reserved.update({"-m", "-c", "--config", "--profile", "--oss", "--local-provider",
152
155
  "--base_url"})
@@ -156,8 +159,17 @@ def validate_native_args(harness: str, native_args: tuple[str, ...]) -> None:
156
159
  for index, argument in enumerate(native_args):
157
160
  if positional:
158
161
  continue
162
+ if harness == "opencode" and argument == "--":
163
+ positional = True
164
+ continue
159
165
  if argument in reserved or any(argument.startswith(option + "=") for option in reserved):
160
166
  raise LaunchError(f"Native argument {argument.split('=', 1)[0]} is reserved by Bloom")
167
+ if harness == "opencode" and argument.startswith("-") and not argument.startswith("--"):
168
+ short_options = argument[1:].split("=", 1)[0]
169
+ if "m" in short_options:
170
+ raise LaunchError(
171
+ f"Native argument {argument.split('=', 1)[0]} is reserved by Bloom"
172
+ )
161
173
  if harness == "codex" and not argument.startswith("-"):
162
174
  codex_commands = {"exec", "review", "login", "logout", "mcp", "app-server",
163
175
  "remote-control", "app", "completion", "update", "doctor",
@@ -227,9 +239,23 @@ def prepare_claude(connection: SelectedConnection, *, executable: Path, cwd: Pat
227
239
  raise LaunchError("Cannot prepare private Claude connection settings") from None
228
240
 
229
241
 
242
+ def _opencode_argv(selector: str, native_args: tuple[str, ...],
243
+ cli_major: Literal[1, 2]) -> tuple[str, ...]:
244
+ if cli_major == 1:
245
+ return ("--model", selector, *native_args)
246
+ # OpenCode 2.x reads OPENCODE_CONFIG_CONTENT in its server. Without --standalone the
247
+ # CLI uses, or starts, the shared background service, which would keep this
248
+ # child-only config and its vkey. Always add it: commands that reject the flag
249
+ # (service, serve, pair, upgrade, ...) stop at flag parsing before they run.
250
+ # Give the value explicitly: a bare --standalone would take a following "false",
251
+ # "0", "no" or "off" (for example a directory name) as its value.
252
+ return ("--standalone=true", *native_args)
253
+
254
+
230
255
  def prepare_opencode(connection: SelectedConnection, *, executable: Path, cwd: Path,
231
256
  environment: Mapping[str, str],
232
- native_args: tuple[str, ...] = ()) -> LaunchPlan:
257
+ native_args: tuple[str, ...] = (),
258
+ cli_major: Literal[1, 2] = 2) -> LaunchPlan:
233
259
  validate_native_args("opencode", native_args)
234
260
  try:
235
261
  config = json.loads(environment.get("OPENCODE_CONFIG_CONTENT") or "{}")
@@ -254,8 +280,8 @@ def prepare_opencode(connection: SelectedConnection, *, executable: Path, cwd: P
254
280
  child = dict(environment)
255
281
  child["OPENCODE_CONFIG_CONTENT"] = json.dumps(config)
256
282
  return LaunchPlan(
257
- executable=executable, argv=("--model", selector, *native_args), cwd=cwd,
258
- child_environment=child,
283
+ executable=executable, argv=_opencode_argv(selector, native_args, cli_major),
284
+ cwd=cwd, child_environment=child,
259
285
  )
260
286
  except (ValueError, TypeError, AttributeError):
261
287
  raise LaunchError("Cannot overlay OpenCode inline connection settings; "
@@ -67,6 +67,9 @@ def probe(bloom: Path, root: Path) -> None:
67
67
  executable = f"#!{sys.executable}\n" + '''
68
68
  import json, os, sys
69
69
  from pathlib import Path
70
+ if sys.argv[1:] == ['--version']:
71
+ print('opencode v2.3.2')
72
+ raise SystemExit(0)
70
73
  if '--settings' in sys.argv:
71
74
  overlay = Path(sys.argv[sys.argv.index('--settings') + 1])
72
75
  env = json.loads(overlay.read_text())['env']
@@ -74,6 +77,7 @@ if '--settings' in sys.argv:
74
77
  assert env['ANTHROPIC_MODEL'] == 'openai/fixture-model'
75
78
  else:
76
79
  config = json.loads(os.environ['OPENCODE_CONFIG_CONTENT'])
80
+ assert sys.argv[1:] == ['--standalone=true']
77
81
  assert config['model'] == 'bloom/openai/fixture-model'
78
82
  assert config['provider']['bloom']['options']['apiKey'] == 'fixture-installed-vkey'
79
83
  assert os.getcwd() == os.environ['EXPECTED_CWD']
@@ -59,6 +59,7 @@ def sandbox_prefix(root, executable):
59
59
  return []
60
60
  # Permit the explicit executable, but deny personal files even if a native
61
61
  # component ignores HOME. The child cannot contact a non-loopback endpoint.
62
+ # OpenCode 2.x --standalone listens on a private loopback port, so allow loopback inbound.
62
63
  personal_home = Path(pwd.getpwuid(os.getuid()).pw_dir)
63
64
  exceptions = " ".join(
64
65
  f"(require-not (literal {json.dumps(str(path))}))"
@@ -69,6 +70,7 @@ def sandbox_prefix(root, executable):
69
70
  '(version 1) (allow default) (deny network*)\n'
70
71
  '(allow network-outbound (remote ip "localhost:*"))\n'
71
72
  '(allow network-bind (local ip "localhost:*"))\n'
73
+ '(allow network-inbound (local ip "localhost:*"))\n'
72
74
  f'(deny file-read* (require-all (subpath {json.dumps(str(personal_home))}) '
73
75
  f'{exceptions}))\n'
74
76
  f'(deny file-write* (subpath {json.dumps(str(personal_home))}))\n'
@@ -101,7 +103,8 @@ def native_version(executable, prefix, environment, cwd):
101
103
  status, output = bounded_run(
102
104
  [*prefix, str(executable), "--version"], environment=environment, cwd=cwd, timeout=15,
103
105
  )
104
- version = re.search(r"\b\d+\.\d+\.\d+(?:[-+][\w.]+)?\b", output)
106
+ # OpenCode 2.x prints "opencode v2.3.2"; there is no word boundary after the "v".
107
+ version = re.search(r"(?<![\d.])\d+\.\d+\.\d+(?:[-+][\w.]+)?\b", output)
105
108
  diagnostic = output.replace(VKEY, "<redacted>")[:1200] if status == 65 else ""
106
109
  assert status == 0 and version, (
107
110
  f"Isolated native version failed: status={status} {diagnostic}"
@@ -14,7 +14,7 @@ import pytest
14
14
  from test_release_workflow import step
15
15
 
16
16
  ROOT = Path(__file__).resolve().parents[1]
17
- STEM = "bloom_launch-0.3.1"
17
+ STEM = "bloom_launch-0.4.0"
18
18
  INFO = f"{STEM}.dist-info"
19
19
  CLASSIFIERS = (
20
20
  "Development Status :: 3 - Alpha",
@@ -34,7 +34,7 @@ HANDOFF = (
34
34
  @pytest.fixture
35
35
  def artifacts(tmp_path):
36
36
  metadata = (
37
- "Metadata-Version: 2.4\nName: bloom-launch\nVersion: 0.3.1\n"
37
+ "Metadata-Version: 2.4\nName: bloom-launch\nVersion: 0.4.0\n"
38
38
  "Summary: Scoped launcher for native coding harnesses\nRequires-Python: >=3.12\n"
39
39
  "Description-Content-Type: text/markdown\nLicense-Expression: Apache-2.0\n"
40
40
  "License-File: LICENSE\n"
@@ -77,6 +77,9 @@ def test_codex_forwards_native_show_config(monkeypatch):
77
77
  @pytest.mark.parametrize("argv", [
78
78
  ["launch", "claude", "--", "--settings", "/tmp/other.json"],
79
79
  ["launch", "opencode", "--", "--model", "other-model"],
80
+ ["launch", "opencode", "run", "-m", "other/model", "say hi"],
81
+ ["launch", "opencode", "--", "--server", "http://127.0.0.1:4096"],
82
+ ["launch", "opencode", "--", "--standalone"],
80
83
  ["launch", "codex", "--", "--model", "other-model"],
81
84
  ["launch", "codex", "--", "-m", "other-model"],
82
85
  ["launch", "codex", "--", "--config", "model='other-model'"],
@@ -18,6 +18,7 @@ def limits_launch(tmp_path, monkeypatch):
18
18
  monkeypatch.setenv("HOME", str(tmp_path))
19
19
  monkeypatch.setenv("CLAUDE_CODE_MAX_CONTEXT_TOKENS", "native-budget")
20
20
  monkeypatch.setattr(launch_module.shutil, "which", lambda *_args, **_kwargs: "/fake/harness")
21
+ monkeypatch.setattr(launch_module, "_validate_opencode_version", lambda _executable: 2)
21
22
  monkeypatch.setattr(launch_module, "connected_models", lambda *_args: (A, B))
22
23
  monkeypatch.setattr(launch_module, "prompt_vkey", lambda: Secret("fixture-key"))
23
24
  monkeypatch.setattr("builtins.input", lambda _: "1")
@@ -78,16 +78,20 @@ def test_original_native_connection_and_configuration(adapter, tmp_path):
78
78
  tracked.extend([settings, instructions])
79
79
  before_files = {path: path.read_bytes() for path in tracked}
80
80
  before_environment = dict(environment)
81
+ options = {}
82
+ if adapter == "opencode":
83
+ options["cli_major"] = 1 if version.startswith("1.") else 2
81
84
  with local_gateway() as (base_url, requests):
82
85
  plan = prepare(SelectedConnection(base_url, MODEL, Secret(VKEY)),
83
- executable=executable, cwd=project, environment=environment)
86
+ executable=executable, cwd=project, environment=environment,
87
+ native_args=arguments, **options)
84
88
  assert plan.cwd == project
85
89
  assert environment == before_environment
86
90
  if adapter == "opencode":
87
91
  inline = json.loads(plan.child_environment["OPENCODE_CONFIG_CONTENT"])
88
92
  assert inline["permission"] == {"bash": "deny"}
89
93
  assert inline["username"] == "native-smoke-fixture"
90
- status, output = execute_plan(plan, arguments, prefix, environment)
94
+ status, output = execute_plan(plan, (), prefix, environment)
91
95
  # Never print captured native output, request bodies, or authentication headers.
92
96
  paths = [path.split("?")[0] for path, _, _ in requests]
93
97
  summary = f"adapter={adapter} version={version} status={status} requests={paths}"
@@ -0,0 +1,180 @@
1
+ import json
2
+ import subprocess
3
+ from pathlib import Path
4
+
5
+ import pytest
6
+
7
+ from bloom_cli import launch as launch_module
8
+ from bloom_cli.contract import LaunchError, Secret, SelectedConnection
9
+ from bloom_cli.settings import save_selection
10
+ from bloom_cli.wrappers import prepare_opencode
11
+
12
+ CONNECTION = SelectedConnection(
13
+ "https://gateway.example", "openai/model-a", Secret("fixture-key"),
14
+ agent_id="fixture-agent",
15
+ )
16
+
17
+
18
+ def _plan(tmp_path, native_args=(), **options):
19
+ return prepare_opencode(CONNECTION, executable=Path("/fake/opencode"), cwd=tmp_path,
20
+ environment={}, native_args=native_args, **options)
21
+
22
+
23
+ @pytest.mark.parametrize("native_args, argv", [
24
+ ((), ("--standalone=true",)),
25
+ (("run", "say hi"), ("--standalone=true", "run", "say hi")),
26
+ (("mini",), ("--standalone=true", "mini")),
27
+ (("../project",), ("--standalone=true", "../project")),
28
+ (("--continue",), ("--standalone=true", "--continue")),
29
+ ])
30
+ def test_opencode_2x_uses_private_server_without_root_model_flag(tmp_path, native_args, argv):
31
+ plan = _plan(tmp_path, native_args)
32
+ assert plan.argv == argv
33
+ config = json.loads(plan.child_environment["OPENCODE_CONFIG_CONTENT"])
34
+ assert config["model"] == config["small_model"] == "bloom/openai/model-a"
35
+ assert config["provider"]["bloom"]["models"] == {"openai/model-a": {"name": "openai/model-a"}}
36
+
37
+
38
+ @pytest.mark.parametrize("native_args", [
39
+ ("debug", "config"), ("debug", "agents"), ("mcp", "list"), ("plugin", "list"),
40
+ ("session", "list"), ("auth", "list"), ("models",),
41
+ ])
42
+ def test_opencode_2x_leaf_commands_use_private_server(tmp_path, native_args):
43
+ assert _plan(tmp_path, native_args).argv == ("--standalone=true", *native_args)
44
+
45
+
46
+ @pytest.mark.parametrize("native_args", [
47
+ # These reject --standalone, so OpenCode stops at flag parsing before it can start or
48
+ # change the shared background service with Bloom's inline credentials.
49
+ ("service", "start"), ("serve", "--service"), ("pair",), ("upgrade",), ("acp",),
50
+ ("--print-logs", "service", "start"), ("debug", "paths"),
51
+ ])
52
+ def test_opencode_2x_never_runs_a_command_without_private_server(tmp_path, native_args):
53
+ assert _plan(tmp_path, native_args).argv == ("--standalone=true", *native_args)
54
+
55
+
56
+ @pytest.mark.parametrize("directory", ["false", "0", "no", "off", "true"])
57
+ def test_opencode_2x_boolean_like_first_argument_stays_positional(tmp_path, directory):
58
+ # A bare "--standalone false" makes OpenCode read "false" as the flag value and use
59
+ # the shared service. The explicit value keeps the directory a positional argument.
60
+ assert _plan(tmp_path, (directory,)).argv == ("--standalone=true", directory)
61
+
62
+
63
+ def test_opencode_1x_keeps_root_model_selector(tmp_path):
64
+ plan = _plan(tmp_path, ("run", "say hi"), cli_major=1)
65
+ assert plan.argv == ("--model", "bloom/openai/model-a", "run", "say hi")
66
+
67
+
68
+ def test_opencode_config_is_the_same_for_1x_and_2x(tmp_path):
69
+ first = _plan(tmp_path, cli_major=1).child_environment
70
+ second = _plan(tmp_path, cli_major=2).child_environment
71
+ assert first == second
72
+
73
+
74
+ @pytest.mark.parametrize("native_args", [
75
+ ("run", "-m", "other/model", "say hi"),
76
+ ("run", "-cm=openai/other", "say hi"),
77
+ ("run", "--model", "other/model", "say hi"),
78
+ ("--server", "http://127.0.0.1:4096"),
79
+ ("--server=http://127.0.0.1:4096",),
80
+ ("--standalone",),
81
+ ("run", "--standalone", "say hi"),
82
+ ])
83
+ def test_opencode_rejects_model_and_server_overrides(tmp_path, native_args):
84
+ with pytest.raises(LaunchError, match="reserved"):
85
+ _plan(tmp_path, native_args)
86
+
87
+
88
+ @pytest.mark.parametrize("native_args", [
89
+ ("run", "-c"),
90
+ ("run", "-s=session-1"),
91
+ ("run", "--", "-minimal"),
92
+ ])
93
+ def test_opencode_allows_unreserved_short_options(tmp_path, native_args):
94
+ assert _plan(tmp_path, native_args).argv == ("--standalone=true", *native_args)
95
+
96
+
97
+ def _version_result(stdout):
98
+ return type("Result", (), {"stdout": stdout})()
99
+
100
+
101
+ @pytest.mark.parametrize("stdout, major", [
102
+ ("opencode v2.3.2\n", 2),
103
+ ("2.3.2\n", 2),
104
+ ("v2.4.0\n", 2),
105
+ ("opencode v2.10.0-beta.1\n", 2),
106
+ ("2.3.3-rc.1\n", 2),
107
+ ("2.3.2+build.5\n", 2),
108
+ ("1.19.0\n", 1),
109
+ ("\n1.0.0\n", 1),
110
+ ])
111
+ def test_opencode_supported_versions(monkeypatch, stdout, major):
112
+ calls = []
113
+
114
+ def run(*args, **kwargs):
115
+ calls.append((args, kwargs))
116
+ return _version_result(stdout)
117
+
118
+ monkeypatch.setattr(launch_module.subprocess, "run", run)
119
+ assert launch_module._validate_opencode_version(Path("/fake/opencode")) == major
120
+ assert calls[0][0][0] == ("/fake/opencode", "--version")
121
+ assert calls[0][1]["timeout"] == 5
122
+
123
+
124
+ @pytest.mark.parametrize("stdout", [
125
+ "", " \n", "0.15.0\n", "2.3.1\n", "opencode v2.0.0\n", "3.0.0\n", "opencode\n",
126
+ "version 2.3.2 (dev)\n", "opencode v2.3.2-rc.1\n", "2.3.2-beta\n",
127
+ "0.0.0-beta-202611190000\n",
128
+ ])
129
+ def test_opencode_unsupported_versions_are_refused(monkeypatch, stdout):
130
+ monkeypatch.setattr(launch_module.subprocess, "run",
131
+ lambda *args, **kwargs: _version_result(stdout))
132
+ with pytest.raises(LaunchError, match="OpenCode 1.x or 2.3.2 or later 2.x"):
133
+ launch_module._validate_opencode_version(Path("/fake/opencode"))
134
+
135
+
136
+ @pytest.mark.parametrize("error", [
137
+ OSError("missing"), subprocess.TimeoutExpired("opencode", 5),
138
+ subprocess.CalledProcessError(1, "opencode"),
139
+ ])
140
+ def test_opencode_version_probe_failure_is_refused(monkeypatch, error):
141
+ def run(*args, **kwargs):
142
+ raise error
143
+
144
+ monkeypatch.setattr(launch_module.subprocess, "run", run)
145
+ with pytest.raises(LaunchError, match="Cannot verify OpenCode version"):
146
+ launch_module._validate_opencode_version(Path("/fake/opencode"))
147
+
148
+
149
+ @pytest.mark.parametrize("stdout, argv", [
150
+ ("opencode v2.3.2\n", ("--standalone=true", "run", "hi")),
151
+ ("1.19.0\n", ("--model", "bloom/openai/model-a", "run", "hi")),
152
+ ])
153
+ def test_cached_opencode_launch_uses_detected_major_version(tmp_path, monkeypatch, stdout, argv):
154
+ monkeypatch.setenv("HOME", str(tmp_path))
155
+ monkeypatch.delenv("OPENCODE_CONFIG_CONTENT", raising=False)
156
+ monkeypatch.setattr(launch_module.shutil, "which", lambda *_args, **_kwargs: "/fake/opencode")
157
+ monkeypatch.setattr(launch_module.subprocess, "run",
158
+ lambda *args, **kwargs: _version_result(stdout))
159
+ save_selection(tmp_path / ".config/bloom/launcher.json", "https://gateway.example",
160
+ "opencode", "openai/model-a", vkey=Secret("fixture-key"))
161
+ captured = {}
162
+ monkeypatch.setattr(launch_module, "run_launch",
163
+ lambda plan: captured.update(plan=plan) or 0)
164
+ assert launch_module.launch("opencode", base_url="https://gateway.example",
165
+ native_args=("run", "hi")) == 0
166
+ assert captured["plan"].argv == argv
167
+
168
+
169
+ def test_unsupported_opencode_version_stops_before_vkey_prompt(tmp_path, monkeypatch):
170
+ monkeypatch.setenv("HOME", str(tmp_path))
171
+ monkeypatch.setattr(launch_module.shutil, "which", lambda *_args, **_kwargs: "/fake/opencode")
172
+ monkeypatch.setattr(launch_module.subprocess, "run",
173
+ lambda *args, **kwargs: _version_result("2.2.0\n"))
174
+
175
+ def forbidden():
176
+ pytest.fail("vkey prompt reached before the OpenCode version check")
177
+
178
+ monkeypatch.setattr(launch_module, "prompt_vkey", forbidden)
179
+ with pytest.raises(LaunchError, match="Unsupported OpenCode version 2.2.0"):
180
+ launch_module.launch("opencode", base_url="https://gateway.example")
@@ -14,8 +14,8 @@ import pytest
14
14
  import yaml
15
15
 
16
16
  ROOT = Path(__file__).resolve().parents[1]
17
- WHEEL = "bloom_launch-0.3.1-py3-none-any.whl"
18
- SDIST = "bloom_launch-0.3.1.tar.gz"
17
+ WHEEL = "bloom_launch-0.4.0-py3-none-any.whl"
18
+ SDIST = "bloom_launch-0.4.0.tar.gz"
19
19
 
20
20
 
21
21
  def workflow():
@@ -307,7 +307,7 @@ def test_real_uv_build_passes_actual_receipt_and_manual_verification(tmp_path):
307
307
 
308
308
  [project]
309
309
  name = "bloom-launch"
310
- version = "0.3.1"
310
+ version = "0.4.0"
311
311
  '''))
312
312
  (project / "release_test_backend.py").write_text(textwrap.dedent('''\
313
313
  import base64
@@ -318,8 +318,8 @@ def test_real_uv_build_passes_actual_receipt_and_manual_verification(tmp_path):
318
318
  import zipfile
319
319
  from pathlib import Path
320
320
 
321
- STEM = "bloom_launch-0.3.1"
322
- METADATA = b"Metadata-Version: 2.4\\nName: bloom-launch\\nVersion: 0.3.1\\n"
321
+ STEM = "bloom_launch-0.4.0"
322
+ METADATA = b"Metadata-Version: 2.4\\nName: bloom-launch\\nVersion: 0.4.0\\n"
323
323
 
324
324
  def build_sdist(sdist_directory, config_settings=None):
325
325
  name = STEM + ".tar.gz"
@@ -70,6 +70,7 @@ def test_cli_invalid_unicode_preserves_settings_without_launch(
70
70
  monkeypatch.chdir(tmp_path)
71
71
  monkeypatch.setattr("bloom_cli.launch.shutil.which", lambda *_args, **_kwargs:
72
72
  str(tmp_path / "fake-native"))
73
+ monkeypatch.setattr("bloom_cli.launch._validate_opencode_version", lambda _executable: 2)
73
74
 
74
75
  def forbidden(*_args, **_kwargs):
75
76
  pytest.fail("Invalid credential reached discovery or native launch")
@@ -58,6 +58,9 @@ def journey(tmp_path, monkeypatch):
58
58
  import json, os, sys
59
59
  from pathlib import Path
60
60
  env = dict(os.environ)
61
+ if sys.argv[1:] == ['--version']:
62
+ print(env.get('FIXTURE_OPENCODE_VERSION', 'opencode v2.3.2'))
63
+ raise SystemExit(0)
61
64
  expected_key = env.get('FIXTURE_EXPECTED_VKEY', 'fixture-vkey')
62
65
  settings = {}
63
66
  if '--settings' in sys.argv:
@@ -301,6 +304,7 @@ def test_opencode_uses_shared_flow_and_preserves_inline_workflow(journey, monkey
301
304
  }))
302
305
  assert main(["launch", "opencode", "--base_url", journey["url"]]) == 0
303
306
  native = json.loads(journey["record"].read_text())
307
+ assert native["argv"] == ["--standalone=true"]
304
308
  assert native["config"]["model"] == "bloom/openai/model-a"
305
309
  assert native["config"]["small_model"] == "bloom/openai/model-a"
306
310
  assert native["config"]["permission"] == {"edit": "ask"}
@@ -39,7 +39,7 @@ def validate_configuration():
39
39
  'baseURL': 'https://fixture.invalid/v1', 'apiKey': 'synthetic-vkey'}
40
40
  assert config['model'] == config['small_model'] == 'bloom/fixture-model'
41
41
  assert config['permission'] == {'bash': 'deny'}
42
- assert native_argv[1:] == ['--model', 'bloom/fixture-model']
42
+ assert native_argv[1:] == ['--standalone=true']
43
43
  sys.argv = [native_argv[0], str(root), 'cycles']
44
44
  '''
45
45
 
@@ -4,7 +4,7 @@ requires-python = ">=3.12"
4
4
 
5
5
  [[package]]
6
6
  name = "bloom-launch"
7
- version = "0.3.1"
7
+ version = "0.4.0"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "keyring" },
File without changes
File without changes
File without changes