mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-07 05:32:20 +01:00
Preserve preview harness, editor, email and task improvements
Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
This commit is contained in:
@@ -28,3 +28,27 @@ def test_done_is_published_only_after_generator_cleanup():
|
||||
agent_runs._RUNS.pop(session_id, None)
|
||||
|
||||
asyncio.run(scenario())
|
||||
|
||||
|
||||
def test_finish_request_is_bound_to_the_exact_active_run():
|
||||
async def scenario():
|
||||
session_id = 'finish-editor-run-test'
|
||||
gate = asyncio.Event()
|
||||
|
||||
async def stream():
|
||||
await gate.wait()
|
||||
yield 'data: [DONE]\n\n'
|
||||
|
||||
run = agent_runs.start(session_id, stream())
|
||||
await asyncio.sleep(0)
|
||||
assert not agent_runs.request_finish(session_id, 'stale-run-id')
|
||||
assert not agent_runs.should_finish(session_id)
|
||||
assert agent_runs.request_finish(session_id, run.run_id)
|
||||
assert agent_runs.should_finish(session_id)
|
||||
gate.set()
|
||||
async for _ in agent_runs.subscribe(session_id, run):
|
||||
pass
|
||||
assert not agent_runs.should_finish(session_id)
|
||||
agent_runs._RUNS.pop(session_id, None)
|
||||
|
||||
asyncio.run(scenario())
|
||||
|
||||
Reference in New Issue
Block a user