Dhanji R. Prasanna
5e45e110e2
refactor(g3-core): extract finalize_streaming_turn() to unify return paths
Extract a single canonical helper function for completing streaming turns,
eliminating 3 nearly-identical return paths in stream_completion_with_tools().
Changes:
- Add finalize_streaming_turn() helper that handles:
- Finishing streaming markdown
- Saving context window
- Adding timing footer (when requested)
- Dehydrating context (when ACD enabled)
- Building TaskResult
- Replace 3 duplicated return blocks with calls to the helper
- Remove unused mut on full_response variable
Results:
- Function reduced from 1067 to 999 lines (-68 lines)
- Eliminated code-path aliasing: 3 paths → 1 canonical path
- All 32 characterization tests pass
- Full g3-core test suite passes
Agent: fowler
2026-01-13 16:52:48 +05:30
..
2026-01-13 15:01:12 +05:30
2026-01-10 20:44:23 +11:00
2026-01-10 20:34:14 +11:00
2026-01-13 16:52:48 +05:30
2025-12-22 16:27:35 +11:00
2026-01-13 05:49:45 +05:30
2026-01-12 05:13:02 +05:30
2026-01-13 14:42:20 +05:30