Commit 1e7e16d
authored
fix(monitor): route assistant messages to channels for ACP .claude workdirs (#3286)
* fix(monitor): replace dots in project-hash slug so JSONL is found for .claude workdirs (#3286)
Claude Code's project-directory slug replaces every `.` in a path segment
with `-`. Aegis's computeProjectHash preserved the dot, so workdirs like
`<repo>/.claude/worktrees/x` produced a slug that didn't match the actual
`~/.claude/projects/-...-aegis--claude-worktrees-x/` directory.
discoverFromFilesystemFallback then looked in the wrong folder, the
monitor never found the JSONL, and channels.message('message.assistant')
never fired — so assistant replies never reached Telegram / Slack /
webhooks / the legacy transcript endpoint.
Add a `.replace(/\./g, '-')` to segment sanitization and an assertion
covering the .claude case.
Closes #3286
* fix(monitor): forward messages when watcher hasn't started for THIS session (#3286)
The poll-cycle hand-off between checkSession and the JsonlWatcher missed
historical entries discovered via the filesystem-fallback path.
The guard `!this.jsonlWatcher` only checked whether the watcher
*instance* existed (it always does, once initialized). On the discovery
poll — where readMessagesForMonitor's fallback just set jsonlPath and
read every existing JSONL entry — those entries were dropped, then the
watcher attached at end-of-file and saw no further changes for content
that pre-dated its attachment.
Switch to `!this.jsonlWatcher?.isWatching(session.id)` so checkSession
forwards historical entries on the exact poll where the fallback
discovers the JSONL. The watcher takes over for subsequent appends.
Verified end-to-end with the Telegram channel: assistant messages now
fan out to channels for ACP sessions whose workdir was discovered via
the filesystem fallback (combined with the slug-mismatch fix in the
previous commit).
Closes #3286 (combined with previous slug-mismatch fix).
* chore: trigger CI refresh1 parent 35fde64 commit 1e7e16d
3 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
631 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments