optio-opencode 0.6.2__tar.gz → 0.6.4__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 (70) hide show
  1. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/PKG-INFO +2 -2
  2. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/pyproject.toml +2 -2
  3. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/session.py +8 -1
  4. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/types.py +11 -5
  5. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/PKG-INFO +2 -2
  6. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/SOURCES.txt +1 -0
  7. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/requires.txt +1 -1
  8. optio_opencode-0.6.4/tests/test_auto_start_prompt.py +14 -0
  9. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_ui_model.py +54 -0
  10. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/README.md +0 -0
  11. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/setup.cfg +0 -0
  12. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/__init__.py +0 -0
  13. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/account.py +0 -0
  14. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/conversation.py +0 -0
  15. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/cred_watcher.py +0 -0
  16. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/fs_allowlist.py +0 -0
  17. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/host_actions.py +0 -0
  18. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/info.py +0 -0
  19. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/model_probe.py +0 -0
  20. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/prompt.py +0 -0
  21. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/providers/__init__.py +0 -0
  22. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/providers/anthropic.py +0 -0
  23. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/providers/deepseek.py +0 -0
  24. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/providers/openai.py +0 -0
  25. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/providers/xai.py +0 -0
  26. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/seed_manifest.py +0 -0
  27. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/snapshots.py +0 -0
  28. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/todos.py +0 -0
  29. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode/verify.py +0 -0
  30. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/dependency_links.txt +0 -0
  31. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/top_level.txt +0 -0
  32. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_account.py +0 -0
  33. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_account_xai_apikey.py +0 -0
  34. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_agent_info.py +0 -0
  35. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_agent_sender_opencode.py +0 -0
  36. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_claustrum.py +0 -0
  37. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_config_harmonization.py +0 -0
  38. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_config.py +0 -0
  39. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_driver.py +0 -0
  40. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_session.py +0 -0
  41. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_ui_session.py +0 -0
  42. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_conversation_upload.py +0 -0
  43. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_cred_watcher.py +0 -0
  44. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_file_download.py +0 -0
  45. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_file_upload.py +0 -0
  46. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_actions.py +0 -0
  47. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_local.py +0 -0
  48. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_primitives_local.py +0 -0
  49. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_primitives_remote.py +0 -0
  50. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_remote_resume.py +0 -0
  51. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_host_resume.py +0 -0
  52. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_model_probe.py +0 -0
  53. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_model_probe_wiring.py +0 -0
  54. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_prompt.py +0 -0
  55. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_provider_deepseek.py +0 -0
  56. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_purge_seed.py +0 -0
  57. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_sanity.py +0 -0
  58. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_seed_config.py +0 -0
  59. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_blob_hooks.py +0 -0
  60. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_hooks.py +0 -0
  61. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_local.py +0 -0
  62. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_remote.py +0 -0
  63. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_resume.py +0 -0
  64. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_seed.py +0 -0
  65. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_session_seed_saveback.py +0 -0
  66. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_smart_install.py +0 -0
  67. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_snapshots.py +0 -0
  68. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_todos.py +0 -0
  69. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_types.py +0 -0
  70. {optio_opencode-0.6.2 → optio_opencode-0.6.4}/tests/test_verify_seed.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optio-opencode
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: Run opencode web as an optio task; local subprocess or remote via SSH.
5
5
  Author-email: Kristof Csillag <kristof.csillag@deai-labs.com>
6
6
  License-Expression: Apache-2.0
@@ -20,7 +20,7 @@ Classifier: Topic :: Software Development :: Code Generators
20
20
  Classifier: Framework :: AsyncIO
21
21
  Requires-Python: >=3.11
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: optio-core<0.5,>=0.4
23
+ Requires-Dist: optio-core<0.6,>=0.5
24
24
  Requires-Dist: optio-host<0.4,>=0.3
25
25
  Requires-Dist: optio-agents<0.7,>=0.6
26
26
  Requires-Dist: optio-claudecode<0.7,>=0.6
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "optio-opencode"
7
- version = "0.6.2"
7
+ version = "0.6.4"
8
8
  description = "Run opencode web as an optio task; local subprocess or remote via SSH."
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -26,7 +26,7 @@ classifiers = [
26
26
  "Framework :: AsyncIO",
27
27
  ]
28
28
  dependencies = [
29
- "optio-core>=0.4,<0.5",
29
+ "optio-core>=0.5,<0.6",
30
30
  # 0.1.1 introduces the bind_addr kwarg on Host.establish_tunnel —
31
31
  # required for OPTIO_WIDGET_TUNNEL_BIND to work.
32
32
  "optio-host>=0.3,<0.4",
@@ -68,7 +68,9 @@ READY_TIMEOUT_S = 30.0
68
68
 
69
69
  # Fresh-launch kickoff prompt POSTed to the pre-created opencode session so the
70
70
  # agent starts the task unattended. Suppressed on resume.
71
- AUTO_START_PROMPT = "Read AGENTS.md and execute the task it describes"
71
+ # A harness message (System: prefix), like the resume notice: the agent is
72
+ # not handed a turn that reads as the human typing.
73
+ AUTO_START_PROMPT = f"{SYSTEM_MESSAGE_PREFIX}Read AGENTS.md and execute the task it describes"
72
74
 
73
75
 
74
76
  def _build_host(config: OpencodeTaskConfig, process_id: str) -> Host:
@@ -174,6 +176,11 @@ def conversation_widget_data(config: "OpencodeTaskConfig", *, session_id: str, d
174
176
  "toolVerbosity": config.tool_verbosity,
175
177
  "thinkingVerbosity": config.thinking_verbosity,
176
178
  "showSessionControls": config.show_session_controls,
179
+ # The session_controls allowlist (None: every control). opencode's
180
+ # control snapshots are built client-side (OpencodeView, from the live
181
+ # provider catalog) and its model/effort changes are UI-local (no
182
+ # /control endpoint), so the view narrows its snapshots with this.
183
+ "sessionControls": config.session_controls,
177
184
  "nativeSpinner": config.native_spinner,
178
185
  "defaultModel": config.model,
179
186
  # Initial effort ("thought level") the widget seeds its effort slider
@@ -18,7 +18,11 @@ from optio_agents import (
18
18
  TOOL_VERBOSITIES,
19
19
  ToolVerbosity,
20
20
  )
21
- from optio_agents.config_types import BlobCryptoConfigMixin, ClaustrumConfigMixin
21
+ from optio_agents.config_types import (
22
+ BlobCryptoConfigMixin,
23
+ ClaustrumConfigMixin,
24
+ SessionControlsConfigMixin,
25
+ )
22
26
  from optio_agents.protocol.session import (
23
27
  CallerMessageCallback,
24
28
  DeliverableCallback,
@@ -73,7 +77,7 @@ def _identity_resume_refresh(config: "OpencodeTaskConfig") -> "OpencodeTaskConfi
73
77
 
74
78
 
75
79
  @dataclass(frozen=True, kw_only=True)
76
- class OpencodeTaskConfig(ClaustrumConfigMixin, BlobCryptoConfigMixin):
80
+ class OpencodeTaskConfig(ClaustrumConfigMixin, BlobCryptoConfigMixin, SessionControlsConfigMixin):
77
81
  """Configuration for one optio-opencode task instance.
78
82
 
79
83
  Inherits the claustrum filesystem-isolation triad (``fs_isolation`` /
@@ -186,9 +190,10 @@ class OpencodeTaskConfig(ClaustrumConfigMixin, BlobCryptoConfigMixin):
186
190
  # effort control only appears for a variant-capable model (re-derived on
187
191
  # model change). None leaves opencode's per-model default in place.
188
192
  reasoning_effort: "OpencodeReasoningEffort | None" = None
189
- # Show the model picker in the conversation widget. Requires
190
- # conversation_ui=True.
191
- show_session_controls: bool = False
193
+ # show_session_controls / session_controls come from
194
+ # SessionControlsConfigMixin. opencode's controls: "model" (default
195
+ # config.model) and "reasoning_effort" (variant-capable models only).
196
+ # The bar requires conversation_ui=True.
192
197
  # Replace the generic working-spinner with opencode's on-brand native
193
198
  # spinner in the conversation widget. Requires mode='conversation' and
194
199
  # conversation_ui=True.
@@ -237,6 +242,7 @@ class OpencodeTaskConfig(ClaustrumConfigMixin, BlobCryptoConfigMixin):
237
242
  # fails fast before the opencode-specific checks below.
238
243
  self._validate_claustrum()
239
244
  self._validate_blob_crypto()
245
+ self._validate_session_controls()
240
246
  if self.mode not in ("iframe", "conversation"):
241
247
  raise ValueError(
242
248
  f"OpencodeTaskConfig.mode={self.mode!r} is not one of "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optio-opencode
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: Run opencode web as an optio task; local subprocess or remote via SSH.
5
5
  Author-email: Kristof Csillag <kristof.csillag@deai-labs.com>
6
6
  License-Expression: Apache-2.0
@@ -20,7 +20,7 @@ Classifier: Topic :: Software Development :: Code Generators
20
20
  Classifier: Framework :: AsyncIO
21
21
  Requires-Python: >=3.11
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: optio-core<0.5,>=0.4
23
+ Requires-Dist: optio-core<0.6,>=0.5
24
24
  Requires-Dist: optio-host<0.4,>=0.3
25
25
  Requires-Dist: optio-agents<0.7,>=0.6
26
26
  Requires-Dist: optio-claudecode<0.7,>=0.6
@@ -29,6 +29,7 @@ tests/test_account.py
29
29
  tests/test_account_xai_apikey.py
30
30
  tests/test_agent_info.py
31
31
  tests/test_agent_sender_opencode.py
32
+ tests/test_auto_start_prompt.py
32
33
  tests/test_claustrum.py
33
34
  tests/test_config_harmonization.py
34
35
  tests/test_conversation_config.py
@@ -1,4 +1,4 @@
1
- optio-core<0.5,>=0.4
1
+ optio-core<0.6,>=0.5
2
2
  optio-host<0.4,>=0.3
3
3
  optio-agents<0.7,>=0.6
4
4
  optio-claudecode<0.7,>=0.6
@@ -0,0 +1,14 @@
1
+ """The auto-start kickoff is a harness message, not a human one."""
2
+
3
+ from optio_agents.context import SYSTEM_MESSAGE_PREFIX
4
+ from optio_opencode.session import AUTO_START_PROMPT
5
+
6
+
7
+ def test_auto_start_prompt_is_a_system_message():
8
+ # The kickoff comes from the harness: it carries the System: prefix every
9
+ # harness message has, so the agent (told that the human may not be
10
+ # present) is not given a turn that reads as the human typing, and the
11
+ # conversation widget renders it as a System row, not a user bubble.
12
+ assert AUTO_START_PROMPT == (
13
+ f"{SYSTEM_MESSAGE_PREFIX}Read AGENTS.md and execute the task it describes"
14
+ )
@@ -74,6 +74,7 @@ def test_widget_data_carries_model_fields():
74
74
  "toolVerbosity": "verbose",
75
75
  "thinkingVerbosity": "hidden",
76
76
  "showSessionControls": True,
77
+ "sessionControls": None,
77
78
  "nativeSpinner": False,
78
79
  "defaultModel": "opencode/big-pickle",
79
80
  "defaultEffort": "high",
@@ -122,3 +123,56 @@ def test_reasoning_effort_rejects_bad_value():
122
123
  conversation_ui=True,
123
124
  reasoning_effort="turbo",
124
125
  )
126
+
127
+
128
+ # --- the session_controls allowlist (SessionControlsConfigMixin) -------------
129
+
130
+
131
+ def _ui_cfg(**kw):
132
+ base = dict(
133
+ consumer_instructions="task", fs_isolation=False,
134
+ mode="conversation", conversation_ui=True,
135
+ )
136
+ base.update(kw)
137
+ return OpencodeTaskConfig(**base)
138
+
139
+
140
+ def test_the_controls_settings_come_from_the_shared_mixin():
141
+ from optio_agents.config_types import SessionControlsConfigMixin
142
+ assert issubclass(OpencodeTaskConfig, SessionControlsConfigMixin)
143
+ cfg = _ui_cfg(show_session_controls=True, session_controls=["model"])
144
+ assert cfg.settable_controls == ["model"]
145
+
146
+
147
+ def test_session_controls_defaults_to_offering_everything():
148
+ cfg = _ui_cfg(show_session_controls=True)
149
+ assert cfg.session_controls is None
150
+ assert cfg.settable_controls is None
151
+
152
+
153
+ def test_nothing_is_settable_while_the_bar_is_off():
154
+ assert _ui_cfg().settable_controls == []
155
+
156
+
157
+ def test_session_controls_needs_show_session_controls():
158
+ with pytest.raises(ValueError, match="OpencodeTaskConfig: session_controls"):
159
+ _ui_cfg(session_controls=["model"])
160
+
161
+
162
+ def test_session_controls_must_be_a_list_of_ids():
163
+ with pytest.raises(ValueError, match="OpencodeTaskConfig: session_controls"):
164
+ _ui_cfg(show_session_controls=True, session_controls="model")
165
+
166
+
167
+ def test_widget_data_carries_the_session_controls_allowlist():
168
+ # opencode builds its control snapshots client-side (OpencodeView, from the
169
+ # live provider catalog), so the allowlist rides widgetData for the view to
170
+ # narrow them with.
171
+ cfg = _ui_cfg(show_session_controls=True, session_controls=["reasoning_effort"])
172
+ wd = conversation_widget_data(cfg, session_id="s1", directory="/wd")
173
+ assert wd["sessionControls"] == ["reasoning_effort"]
174
+
175
+
176
+ def test_widget_data_session_controls_defaults_to_all():
177
+ wd = conversation_widget_data(_ui_cfg(), session_id="s1", directory="/wd")
178
+ assert wd["sessionControls"] is None
File without changes
File without changes