Diagnose table-padding truncation and complete local-first investigation

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a0cffe-206f-7323-89d3-b20ca4cf4bf9
This commit is contained in:
tegwick 2026-09-25 01:55:22 +02:00
parent 509e86d9c5
commit 90d1f86b8f
50 changed files with 2197 additions and 13 deletions

View file

@ -190,6 +190,7 @@ def test_llm_connect_service_contract(tmp_path, finish, content, complete):
with pytest.raises(ValueError, match='empty or incomplete'):
bench.execute(root, live)
assert len(calls) == 1
assert (root / 'reports/rejected-response.md').read_text() == content
receipt_text = (root / 'reports/research-run.json').read_text()
receipt = json.loads(receipt_text)
assert receipt['responses'][0]['model'] == 'resolved/model'
@ -234,3 +235,22 @@ def test_llm_connect_http_failure_is_safe_and_not_retried(tmp_path):
assert 'SECRET-SENTINEL' not in text + str(raised.value)
finally:
server.stop()
def test_diagnostics_allowlist_excludes_raw_provider_data():
raw = {'debug': {'provider_request': {'headers': {'Authorization': 'SECRET'},
'payload': {'messages': ['SECRET'], 'max_tokens': 1000, 'reasoning_effort': 'low'}},
'provider_response': {'body': {'choices': ['SECRET'], 'usage': {
'total_tokens': 1200, 'cost': 0.01, 'private': 'SECRET',
'completion_tokens_details': {'reasoning_tokens': 900, 'private': 'SECRET'}}}}}}
summary = bench.diagnostic_summary(raw)
assert summary['effective_settings']['reasoning_effort_present']
assert summary['provider_usage']['completion_tokens_details']['reasoning_tokens'] == 900
assert 'SECRET' not in json.dumps(summary)
def test_current_llm_connect_drops_reasoning_effort():
from llm_connect._payload import merge_openai_chat_model_params
payload = {'max_tokens': 1000}
merge_openai_chat_model_params(payload, {'reasoning_effort': 'low'})
assert 'reasoning_effort' not in payload