feat: wire embedding worker call sites in turns/meanwhile/skip/regenerate (T97.5)

This commit is contained in:
Joseph Doherty
2026-04-27 03:08:36 -04:00
parent d85ed8aaa6
commit 177e39d59c
6 changed files with 195 additions and 0 deletions
+3
View File
@@ -103,6 +103,7 @@ async def regenerate_assistant_turn(
chat_id: str,
original_assistant_event_id: int,
edited_user_prose: str | None = None,
app=None,
) -> str:
"""Regenerate the assistant turn linked to ``original_assistant_event_id``.
@@ -414,6 +415,7 @@ async def regenerate_assistant_turn(
narrative_text=new_text,
scene_id=scene["id"] if scene else None,
chat_clock_at=chat.get("time"),
app=app,
)
last_at = chat.get("time")
@@ -648,6 +650,7 @@ async def regenerate_assistant_turn(
narrative_text=interject_text,
scene_id=scene["id"] if scene else None,
chat_clock_at=chat.get("time"),
app=app,
)
# Re-run the multi-pair state-update with the post-interjection
+2
View File
@@ -993,6 +993,7 @@ async def skip_elision(
chat_id=chat_id,
new_time=new_time,
landing_state_hint=landing_state_hint,
app=request.app,
)
except ChatNotFoundError as exc:
# Missing chat row: typed exception (T81) replaces the prior
@@ -1036,6 +1037,7 @@ async def skip_jump(
new_time=new_time,
notable_prose=notable_prose,
reset_activity=reset_flag,
app=request.app,
)
except ChatNotFoundError as exc:
# Missing chat row: typed exception (T81) replaces the prior
+2
View File
@@ -131,6 +131,7 @@ async def process_meanwhile_turn(
*,
chat_id: str,
prose: str,
app=None,
) -> dict:
"""Run one meanwhile turn end-to-end.
@@ -314,6 +315,7 @@ async def process_meanwhile_turn(
narrative_text=text,
scene_id=scene_id,
chat_clock_at=chat.get("time"),
app=app,
)
# 9. Post-turn state-update — exactly 2 directed pairs over the
+3
View File
@@ -91,6 +91,7 @@ async def process_elision_skip(
chat_id: str,
new_time: str,
landing_state_hint: str = "",
app=None,
) -> dict:
"""Run an elision skip end-to-end.
@@ -175,6 +176,7 @@ async def process_jump_skip(
new_time: str,
notable_prose: str = "",
reset_activity: bool = False,
app=None,
) -> dict:
"""Run a jump skip end-to-end.
@@ -254,6 +256,7 @@ async def process_jump_skip(
chat_clock_at=new_time,
source="synthesized",
significance=mem.significance,
app=app,
)
narration = await narrate_skip(
+5
View File
@@ -248,6 +248,7 @@ async def post_turn(
settings,
chat_id=chat_id,
prose=prose,
app=request.app,
)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc))
@@ -352,6 +353,7 @@ async def post_turn(
new_time=new_time,
landing_state_hint=getattr(parsed, "landing_state_hint", "")
or "",
app=request.app,
)
except ChatNotFoundError as exc:
# Defensive: chat existence is checked above, so this only
@@ -512,6 +514,7 @@ async def post_turn(
narrative_text=primary_text,
scene_id=scene["id"] if scene else None,
chat_clock_at=chat.get("time"),
app=request.app,
)
# 7b. Post-turn state-update pass (Requirements §3.4 / T40). All
@@ -746,6 +749,7 @@ async def post_turn(
narrative_text=interjection_text,
scene_id=scene["id"] if scene else None,
chat_clock_at=chat.get("time"),
app=request.app,
)
# T74.2: enqueue a significance pass for the interjection
@@ -1092,6 +1096,7 @@ async def regenerate_turn(
chat_id=chat_id,
original_assistant_event_id=event_id,
edited_user_prose=edited_prose,
app=request.app,
)
except ValueError as e:
raise HTTPException(status_code=404, detail=str(e))