refactor(coding-agent): preserved completed and abandoned tasks in session

- Updated task synchronization to include all todo phases regardless of completion status.
- Removed logic that filtered out completed or abandoned tasks during session synchronization.
This commit is contained in:
can1357
2026-07-11 20:35:43 +02:00
parent 4181ef18b5
commit 6c292b97c3
3 changed files with 6 additions and 8 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Changed
- Retain completed and abandoned tasks in session history for improved context on resume
### Fixed
- Fixed compiled release binaries bundling `fastembed` and baking the build-machine `@anush008/tokenizers` path; native runtime dependencies now stay external for every compiled build path so Mnemopi resolves its on-demand install instead. ([#5195](https://github.com/can1357/oh-my-pi/issues/5195))
@@ -133,8 +133,7 @@ export class TodoCommandController {
/**
* True latest todo state for the user-facing /todo verbs. Reads from session
* entries so that completed/abandoned tasks remain visible after resume
* (where `session.getTodoPhases()` would have stripped them).
* entries or falls back to the active session state.
*/
#currentPhases(): TodoPhase[] {
const fromEntries = getLatestTodoPhasesFromEntries(this.ctx.sessionManager.getBranch());
@@ -8724,12 +8724,7 @@ export class AgentSession {
#syncTodoPhasesFromBranch(): void {
const phases = getLatestTodoPhasesFromEntries(this.sessionManager.getBranch());
// Strip completed/abandoned tasks — they were done in a previous run,
// so they have no bearing on progress tracking for the new turn.
for (const phase of phases) {
phase.tasks = phase.tasks.filter(t => t.status !== "completed" && t.status !== "abandoned");
}
this.setTodoPhases(phases.filter(p => p.tasks.length > 0));
this.setTodoPhases(phases);
}
#cloneTodoPhases(phases: TodoPhase[]): TodoPhase[] {