optio-opencode 0.6.3__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.
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/PKG-INFO +1 -1
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/pyproject.toml +1 -1
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/session.py +8 -1
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/types.py +11 -5
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/PKG-INFO +1 -1
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/SOURCES.txt +1 -0
- optio_opencode-0.6.4/tests/test_auto_start_prompt.py +14 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_ui_model.py +54 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/README.md +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/setup.cfg +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/__init__.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/account.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/conversation.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/cred_watcher.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/fs_allowlist.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/host_actions.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/info.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/model_probe.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/prompt.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/providers/__init__.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/providers/anthropic.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/providers/deepseek.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/providers/openai.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/providers/xai.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/seed_manifest.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/snapshots.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/todos.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode/verify.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/dependency_links.txt +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/requires.txt +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/top_level.txt +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_account.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_account_xai_apikey.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_agent_info.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_agent_sender_opencode.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_claustrum.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_config_harmonization.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_config.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_driver.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_session.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_ui_session.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_conversation_upload.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_cred_watcher.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_file_download.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_file_upload.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_actions.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_local.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_primitives_local.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_primitives_remote.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_remote_resume.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_host_resume.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_model_probe.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_model_probe_wiring.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_prompt.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_provider_deepseek.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_purge_seed.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_sanity.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_seed_config.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_blob_hooks.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_hooks.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_local.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_remote.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_resume.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_seed.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_session_seed_saveback.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_smart_install.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_snapshots.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_todos.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_types.py +0 -0
- {optio_opencode-0.6.3 → optio_opencode-0.6.4}/tests/test_verify_seed.py +0 -0
|
@@ -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
|
-
|
|
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
|
|
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
|
-
#
|
|
190
|
-
#
|
|
191
|
-
|
|
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 "
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{optio_opencode-0.6.3 → optio_opencode-0.6.4}/src/optio_opencode.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|