Commit 0f4e780
codejunkie99
review: fix P2 findings from codex pre-merge review
Final codex review surfaced two P2s that would break upgrades and
downstream salience.
1. install.sh:148 / install.ps1 — the top-level `.agent/` copy is
skipped when the target already has one (line 39-42 / 45-48). So
on an upgrade install of an older agentic-stack project, the pi
extension's `memory-hook.ts` gets dropped, but the Python hook it
invokes (`.agent/harness/hooks/pi_post_tool.py`) never arrives.
Every `tool_result` then fires `missing-hook` forever. Fix: sync
`pi_post_tool.py` explicitly in the pi case, both installers.
2. pi_post_tool.py:152 — `_emit_malformed()` was writing
`importance="medium"` (string). Downstream `salience_score()` does
`importance / 10.0`, which raises TypeError on a string and would
crash context_budget.py, show.py, and auto_dream.py readers of
AGENT_LEARNINGS.jsonl. Fix: use int 5 (middle of the 1-10 scale).
Smoke-tested:
- empty payload → entry has `importance: 5` (int), salience_score
runs to 1.000 without error
- upgrade install on a project with old .agent/ (no pi_post_tool.py)
→ "synced for upgrades" line fires, file now present1 parent d790769 commit 0f4e780
3 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
152 | | - | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
185 | 192 | | |
186 | 193 | | |
187 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
0 commit comments