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.
Projecthongdangmoo49/Trinity
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
| 125 | 125 | """Route plain session text through the current workflow state.""" | |
| 126 | 126 | if self.session.state == WorkflowState.NEEDS_USER_DECISION: | |
| 127 | 127 | 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(): | |
| 132 | 129 | return self.continue_from_blueprint(text, active_agents) | |
| 133 | 130 | return self.start(text, active_agents) | |
| 134 | 131 | ||
| 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 | + | ||
| 135 | 145 | def start( | |
| 136 | 146 | self, | |
| 137 | 147 | goal: str, | |
| ⋯ | |||
| 303 | 313 | ||
| 304 | 314 | if active_agents: | |
| 305 | 315 | self.session.active_agents = list(active_agents) | |
| 316 | + | source_state = self.session.state | |
| 306 | 317 | self.set_state( | |
| 307 | 318 | WorkflowState.DELIBERATING, | |
| 308 | - | reason="user continued from blueprint-ready state", | |
| 319 | + | reason="user continued from existing blueprint", | |
| 309 | 320 | ) | |
| 310 | 321 | self._persist( | |
| 311 | 322 | "workflow_continued", | |
| 312 | 323 | { | |
| 313 | 324 | "instruction": instruction, | |
| 314 | - | "source_state": WorkflowState.BLUEPRINT_READY.value, | |
| 325 | + | "source_state": source_state.value, | |
| 315 | 326 | }, | |
| 316 | 327 | ) | |
| 317 | 328 | return WorkflowInputAction( | |
The check that tells the two apart
fail→pass·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
- 2026-06-17fix: avoid missing workflow events traceback
- 2026-06-05fix(tui): address code quality review for SacredGeometryAnimator
- 2026-06-03fix: make rotation/warning thresholds configurable instead of hardcoded
- 2026-06-03fix(security): prevent path traversal in ManagedHome read/write_config
- 2026-06-02fix: sanitize surrogate characters in SharedContextEngine.write()