From ceac021208567219c3d43725f5828d93a19d2d14 Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:43:34 +0800 Subject: [PATCH] opencode 0.2.0: the manifest's table is [harness], for Pointman node 0.6 The node now calls the program an agent runs on a harness, and reads only [harness] (and harness.install, harness.key, harness.run ...), never [client]. The node range is >=0.6,<1, so nodes older than the rename keep the version they have. Co-authored-by: Pointman Co-authored-by: Claude --- README.md | 6 +++--- extension.toml | 22 +++++++++++----------- scripts/repack.py | 2 +- tests/test_contract.py | 34 +++++++++++++++++----------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index c137047..380ba17 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Pointman OpenCode client +# Pointman OpenCode harness -A standalone client extension for OpenCode **2.2.1**, using the machine's existing +A standalone harness extension for OpenCode **2.2.1**, using the machine's existing OpenCode sign-in. Its official icon is recorded in ICON-SOURCE.md. Requires Pointman node **0.4.3 or newer with AGC-75 support**: `opencode-stream`, @@ -68,7 +68,7 @@ in `tests/fixtures/mcp-contract.json`. Private `XDG_CONFIG_HOME` keeps the machine's user config out of agent runs. Effective config and remember/recall runs were verified with OpenCode 2.2.1 on -mac-m4. No Python or database preflight runs before the client starts. +mac-m4. No Python or database preflight runs before the harness starts. If OpenCode produces no stdout within 120 seconds, the node ends the run with "OpenCode didn't start" and the timeout, rather than waiting silently. diff --git a/extension.toml b/extension.toml index 1b85069..4fcf21b 100644 --- a/extension.toml +++ b/extension.toml @@ -1,35 +1,35 @@ [extension] id = "opencode" name = "OpenCode" -version = "0.1.1" -node = ">=0.4.3" +version = "0.2.0" +node = ">=0.6,<1" publisher = "aurelio" summary = "OpenCode with the machine's sign-in and private agent configuration." -[client] +[harness] binaries = ["opencode"] protocol = "opencode-stream" home_env = "HOME" # Prevent ambient provider keys from replacing the machine's saved sign-in. api_keys = ["ZAI_API_KEY", "ZHIPUAI_API_KEY", "ZHIPU_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY", "OPENCODE_API_KEY"] -[client.install] +[harness.install] # Official binaries are checksum-verified and repacked by this repository. from = "release" repo = "pointman-ai/pointman-opencode" asset = "opencode-{platform}.tar.gz" -[client.sign_in] +[harness.sign_in] how = "opencode auth login (in your normal machine environment)" -[client.run] +[harness.run] prompt = "arg" args = ["run", "--standalone", "--format", "json", "{session}", "{permissions}", "{model}", "--", "{prompt}"] new_session = ["--session", "{value}"] resume = ["--session", "{value}"] model = ["-m", "{value}"] -[client.run.env] +[harness.run.env] XDG_CONFIG_HOME = "{home}/.config" OPENCODE_CONFIG_DIR = "{home}/.config/opencode" XDG_STATE_HOME = "{home}/.local/state" @@ -43,22 +43,22 @@ OPENCODE_DISABLE_CLAUDE_CODE = "1" OPENCODE_DISABLE_CLAUDE_CODE_SKILLS = "1" # XDG_DATA_HOME and OPENCODE_DB require runtime resolution, never static paths. -[client.run.permissions] +[harness.run.permissions] default = ["--auto"] auto = ["--auto"] # The node refuses acceptEdits: --auto would also approve shell/tools. acceptEdits = [] plan = ["--agent", "plan"] -[client.instructions] +[harness.instructions] via = "prompt" -[client.mcp] +[harness.mcp] via = "config-file" file = ".config/opencode/opencode.json" key = "mcp" # opencode-stream runtime translates servers to native remote/local shapes. settings = { model = "zai-coding-plan/glm-5.3" } -[client.limits] +[harness.limits] words = ["rate limit", "rate_limit", "too many requests", "quota exceeded", "usage limit", "insufficient balance"] diff --git a/scripts/repack.py b/scripts/repack.py index 7f76ef6..40edd89 100644 --- a/scripts/repack.py +++ b/scripts/repack.py @@ -50,7 +50,7 @@ def repack(data, target, pin, output): output.mkdir(parents=True, exist_ok=True) name = f'opencode-{target}' dest = output / f'{name}.tar.gz' - # Exact root filename is required by node/src/clients.rs release(). + # Exact root filename is required by the node's harness release install. members = [(name, executable, 0o755), ('LICENSE.opencode', (ROOT / 'LICENSE.opencode').read_bytes(), 0o644), ('upstream.json', (json.dumps(pin, indent=2) + '\n').encode(), 0o644)] diff --git a/tests/test_contract.py b/tests/test_contract.py index da14726..4f4b777 100644 --- a/tests/test_contract.py +++ b/tests/test_contract.py @@ -10,19 +10,19 @@ ROOT = Path(__file__).resolve().parents[1] MANIFEST = tomllib.loads((ROOT / 'extension.toml').read_text()) -CLIENT = MANIFEST['client'] +HARNESS = MANIFEST['harness'] class Contract(unittest.TestCase): def test_install_requires_reviewed_release(self): self.assertEqual(MANIFEST['extension']['id'], 'opencode') - self.assertEqual(CLIENT['protocol'], 'opencode-stream') - self.assertEqual(CLIENT['binaries'], ['opencode']) - self.assertEqual(CLIENT['install'], {'from': 'release', 'repo': 'pointman-ai/pointman-opencode', 'asset': 'opencode-{platform}.tar.gz'}) - self.assertNotIn('npm', CLIENT) + self.assertEqual(HARNESS['protocol'], 'opencode-stream') + self.assertEqual(HARNESS['binaries'], ['opencode']) + self.assertEqual(HARNESS['install'], {'from': 'release', 'repo': 'pointman-ai/pointman-opencode', 'asset': 'opencode-{platform}.tar.gz'}) + self.assertNotIn('npm', HARNESS) def test_exact_session_and_prompt_boundary(self): - run = CLIENT['run'] + run = HARNESS['run'] self.assertEqual(run['prompt'], 'arg') for name in ('new_session', 'resume'): self.assertEqual(run[name], ['--session', '{value}']) @@ -33,8 +33,8 @@ def test_exact_session_and_prompt_boundary(self): self.assertFalse({'--continue', '--server', '--fork'} & set(run['args'])) def test_private_config_without_hardcoding_machine_data(self): - self.assertEqual(CLIENT['home_env'], 'HOME') - env = CLIENT['run']['env'] + self.assertEqual(HARNESS['home_env'], 'HOME') + env = HARNESS['run']['env'] for name in ('XDG_CONFIG_HOME', 'XDG_CACHE_HOME', 'XDG_STATE_HOME', 'OPENCODE_CONFIG_DIR', 'OPENCODE_CONFIG', 'OPENCODE_TEST_HOME'): self.assertTrue(env[name].startswith('{home}'), name) @@ -44,19 +44,19 @@ def test_private_config_without_hardcoding_machine_data(self): for name in ('OPENCODE_CONFIG_PROJECT_DISABLE', 'OPENCODE_DISABLE_PROJECT_CONFIG', 'OPENCODE_DISABLE_CLAUDE_CODE', 'OPENCODE_DISABLE_CLAUDE_CODE_SKILLS'): self.assertEqual(env[name], '1') - self.assertEqual(env['OPENCODE_CONFIG'], '{home}/' + CLIENT['mcp']['file']) + self.assertEqual(env['OPENCODE_CONFIG'], '{home}/' + HARNESS['mcp']['file']) def test_no_vault_key_or_offline_account_probe(self): for name in ('credentials', 'commands', 'permissions'): self.assertNotIn(name, MANIFEST) - self.assertNotIn('key', CLIENT) - self.assertNotIn('check', CLIENT['sign_in']) - self.assertIn('ZAI_API_KEY', CLIENT['api_keys']) + self.assertNotIn('key', HARNESS) + self.assertNotIn('check', HARNESS['sign_in']) + self.assertIn('ZAI_API_KEY', HARNESS['api_keys']) def test_behaviours_model_and_permission_mapping(self): - self.assertEqual(CLIENT['instructions'], {'via': 'prompt'}) - self.assertEqual(CLIENT['mcp']['settings']['model'], 'zai-coding-plan/glm-5.3') - permissions = CLIENT['run']['permissions'] + self.assertEqual(HARNESS['instructions'], {'via': 'prompt'}) + self.assertEqual(HARNESS['mcp']['settings']['model'], 'zai-coding-plan/glm-5.3') + permissions = HARNESS['run']['permissions'] self.assertEqual(permissions['default'], ['--auto']) self.assertEqual(permissions['acceptEdits'], []) self.assertEqual(permissions['plan'], ['--agent', 'plan']) @@ -72,7 +72,7 @@ def test_mcp_fixture_preserves_headers_and_argument_boundaries(self): local = before['local_example'] self.assertEqual(after['local_example']['command'], [local['command'], *local['args']]) self.assertEqual(after['local_example']['environment'], local['env']) - self.assertEqual(CLIENT['mcp']['key'], 'mcp') + self.assertEqual(HARNESS['mcp']['key'], 'mcp') def test_code_evidence_is_versioned_without_runtime_data(self): e = json.loads((ROOT / 'research/installed-evidence.json').read_text()) @@ -93,7 +93,7 @@ def test_v2_help_in_synthetic_home(self): for kind in ('DATA', 'CONFIG', 'CACHE', 'STATE'): env[f'XDG_{kind}_HOME'] = str(root / kind.lower()) env.update({key: value.replace('{home}', folder) - for key, value in CLIENT['run']['env'].items()}) + for key, value in HARNESS['run']['env'].items()}) def probe(*args): result = subprocess.run([binary, *args], cwd=folder, env=env, capture_output=True, text=True, timeout=20)