Whole file

hongdangmoo49/Trinity

The author described this change as fix: reuse target workspace for workflow followups. It counts as a record because the check below fails on the code as it stood at 285c62866 and passes on a4791deca, with nothing else changed between the two runs.

Fix saved2026-06-06
Sharing licenceMIT · LICENSE
Change size+17 6

What the code was meant to do, written into the code itself as a save note

fix: reuse target workspace for workflow followups

The change

125125 """Route plain session text through the current workflow state."""
126126 if self.session.state == WorkflowState.NEEDS_USER_DECISION:
127127 return self.answer_pending_question(text)
128- if (
129- self.session.state == WorkflowState.BLUEPRINT_READY
130- and self.session.blueprint is not None
131- ):
128+ if self._can_continue_existing_blueprint():
132129 return self.continue_from_blueprint(text, active_agents)
133130 return self.start(text, active_agents)
134131
132+ def _can_continue_existing_blueprint(self) -> bool:
133+ """Return whether free text should stay attached to this workflow."""
134+ return (
135+ self.session.blueprint is not None
136+ and self.session.state
137+ in {
138+ WorkflowState.BLUEPRINT_READY,
139+ WorkflowState.REVIEWING,
140+ WorkflowState.DONE,
141+ WorkflowState.FAILED,
142+ }
143+ )
144+
135145 def start(
136146 self,
137147 goal: str,
303313
304314 if active_agents:
305315 self.session.active_agents = list(active_agents)
316+ source_state = self.session.state
306317 self.set_state(
307318 WorkflowState.DELIBERATING,
308- reason="user continued from blueprint-ready state",
319+ reason="user continued from existing blueprint",
309320 )
310321 self._persist(
311322 "workflow_continued",
312323 {
313324 "instruction": instruction,
314- "source_state": WorkflowState.BLUEPRINT_READY.value,
325+ "source_state": source_state.value,
315326 },
316327 )
317328 return WorkflowInputAction(

The check that tells the two apart

failpass·tests/test_textual_workflow_controller.py::test_textual_workflow_controller_reuses_target_for_review_followup

Check file tests/test_textual_workflow_controller.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it285c62866065e54ae4e36d41d2c3c19c7d5fa08f
Broken version dated2026-06-06
Moduletrinity.workflow.engine
Units changedWorkflowEngine
Fingerprint71a768ab212e5168
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in hongdangmoo49/Trinity