feat(dsh): show AI readiness and prevent repeated intervention on status changes
Core regression / Python 3.12 core, intervention UI and release configuration (push) Failing after 21s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (pull_request) Failing after 21s
Core regression / JavaScript syntax (pull_request) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (push) Failing after 21s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (pull_request) Failing after 21s
Core regression / JavaScript syntax (pull_request) Successful in 3s
This commit is contained in:
1 parent
bd06bbc7d2
commit
cf6e3f9d2a
28 files changed
+1159
-37
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import pytest
|
||||
from dx_productivity.dsh.native_runtime import launch_environment, write_context
|
||||
from dx_productivity.dsh.snapshot import TaskSnapshot
|
||||
|
||||
@@ -19,6 +20,34 @@ def test_launch_does_not_inherit_unrelated_credentials_or_user_harness_home(tmp_
|
||||
assert env['DX_DSH_HOME'].startswith(str(tmp_path))
|
||||
|
||||
|
||||
def test_selected_native_credential_is_forwarded_without_unrelated_secrets(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv('FIXTURE_SELECTED_API_KEY', 'fake-selected-key')
|
||||
monkeypatch.setenv('FIXTURE_UNRELATED_API_KEY', 'fake-unrelated-key')
|
||||
monkeypatch.setenv('OPENAI_API_KEY', 'fake-openai-key')
|
||||
env = launch_environment(tmp_path, native_model=True, credential_refs=['FIXTURE_SELECTED_API_KEY'])
|
||||
assert env['FIXTURE_SELECTED_API_KEY'] == 'fake-selected-key'
|
||||
assert 'FIXTURE_UNRELATED_API_KEY' not in env
|
||||
assert 'OPENAI_API_KEY' not in env
|
||||
|
||||
|
||||
def test_proven_native_route_can_launch_with_corrupt_unused_host_metadata(tmp_path, monkeypatch):
|
||||
for name in ('DSH_API_BASE', 'DSH_MODEL', 'DSH_API_KEY'):
|
||||
monkeypatch.delenv(name, raising=False)
|
||||
(tmp_path / 'provider.json').write_text('{invalid-metadata', encoding='utf8')
|
||||
monkeypatch.setenv('FIXTURE_SELECTED_API_KEY', 'fake-native-key')
|
||||
env = launch_environment(tmp_path, native_model=True, credential_refs=['FIXTURE_SELECTED_API_KEY'])
|
||||
assert env['FIXTURE_SELECTED_API_KEY'] == 'fake-native-key'
|
||||
assert env['DX_DSH_HOME'] == str(tmp_path / 'harness-home')
|
||||
with pytest.raises(Exception):
|
||||
launch_environment(tmp_path)
|
||||
|
||||
|
||||
def test_invalid_native_credential_reference_does_not_expand_environment_allowlist(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv('FIXTURE_UNRELATED_API_KEY', 'fake-unrelated-key')
|
||||
env = launch_environment(tmp_path, native_model=True, credential_refs=[None, 'invalid-ref', 'A' * 129])
|
||||
assert 'FIXTURE_UNRELATED_API_KEY' not in env
|
||||
|
||||
|
||||
def test_context_publication_survives_a_real_windows_reader_lock(tmp_path):
|
||||
import ctypes
|
||||
from ctypes import wintypes
|
||||
|
||||
Reference in new issue
Block a user