Commit 651a653
committed
refactor: minor audit-driven cleanups
- I-1 already landed in the LRU commit (singleSession resolveProjectIdentity
threaded through transform.ts).
- I-2: Reuse sessionMetaEarly read in system-prompt-hash.ts. The handler
was calling getOrCreateSessionMeta twice per system-prompt transform —
once early for isSubagent detection, again later for hash comparison.
Nothing between the two reads mutates session_meta for that session, so
the second read is redundant. Now short-circuits to the early read.
- M-2: Broaden hasSuccessfulTask's post-task exclusion set in dreamer/
runner.ts. The filter only excluded "smart-notes" from the success
gate, but `user memories` and `key files` post-task phases also run
unconditionally after the main task loop. A project whose configured
tasks (consolidate/verify/archive-stale/...) all failed but whose
post-task phases succeeded would have last_dream_at advanced, silently
suppressing re-scheduling of the failed tasks. Now all three post-task
phase names are excluded from the success gate.
Addresses audit findings I-2 and M-2.1 parent bad700c commit 651a653
2 files changed
Lines changed: 17 additions & 9 deletions
File tree
- packages/plugin/src
- features/magic-context/dreamer
- hooks/magic-context
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
735 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
736 | 742 | | |
737 | 743 | | |
738 | 744 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
367 | 369 | | |
368 | 370 | | |
369 | | - | |
| 371 | + | |
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
| |||
0 commit comments