Commit a28a02c
authored
fix(compaction): respect previous message agent on context injection (#10)
* docs: fix oh-my-opencode hook name
The correct hook name is 'anthropic-context-window-limit-recovery', not 'anthropic-auto-compact'.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(cli): update hook name to anthropic-context-window-limit-recovery
Also update CLI flag from --disable-auto-compact to --disable-context-recovery
to match the new hook naming convention.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
* fix(compaction): respect previous message agent on context injection
Remove hardcoded 'agent: "general"' from injectCompactionContext.
The injectHookMessage function already has fallback logic that uses
findNearestMessageWithFields to get the actual agent from previous messages.
By not passing an explicit agent, we allow the existing fallback to work:
resolvedAgent = originalMessage.agent ?? fallback?.agent ?? "general"
This ensures the compaction context message is correctly attributed to the
agent that was active when compaction was triggered, maintaining proper
agent context across session compaction.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)1 parent 48dd1f6 commit a28a02c
2 files changed
Lines changed: 18 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
285 | | - | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
332 | | - | |
333 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
334 | 346 | | |
335 | 347 | | |
336 | 348 | | |
| |||
381 | 393 | | |
382 | 394 | | |
383 | 395 | | |
| 396 | + | |
384 | 397 | | |
385 | 398 | | |
386 | 399 | | |
| |||
0 commit comments