refactor(envelope): drop the reply counter and the injects line, keep time and vault changes

This commit is contained in:
hh
2026-08-29 02:38:39 +02:00
parent bc4233977d
commit 12728b2eb4
3 changed files with 16 additions and 48 deletions
+4 -10
View File
@@ -591,8 +591,6 @@ class Conversations:
raise ValueError(msg)
if agent is None and kind == "branch" and parent is not None:
agent = parent.agent_name
if kind == "branch" and parent is not None and parent.kind == "master":
await self.set_flags(parent, {"streak": 0})
agent = agent or self.default_agent(kind)
if agent is None:
msg = f"no default agent for kind {kind!r}; pass `agent`"
@@ -1291,7 +1289,7 @@ class Conversations:
if head.priority == "user":
origin = "user"
prompt = head.text
envelope = await self._envelope_for(conv, injects=len(batch) - 1)
envelope = self._envelope_for(conv)
if envelope:
prompt += "\n\n" + envelope
if len(batch) > 1:
@@ -1326,14 +1324,10 @@ class Conversations:
text=text,
)
async def _envelope_for(self, conv: Conversation, *, injects: int) -> str | None:
if conv.kind != "master":
def _envelope_for(self, conv: Conversation) -> str | None:
if conv.kind != "master" or self._envelope is None:
return None
streak = int(conv.flags.get("streak", 0) or 0)
await self.set_flags(conv, {"streak": streak + 1})
if self._envelope is None:
return None
return self._envelope.build(streak=streak, injects=injects)
return self._envelope.build()
def _observer(
self, conv: Conversation, runner: _Runner, turn_id: str, origin: str