feat: enhance Mattermost integration with focused context for standups and improved channel filtering

This commit is contained in:
2026-05-20 07:47:19 -06:00
parent 3d4da1919a
commit ee35f70c3e
6 changed files with 142 additions and 15 deletions

View File

@@ -69,6 +69,30 @@ and `threads/...` when a single discussion thread is the relevant evidence.
This mirrors Slack's export pattern of one folder per conversation with one file
per date, while adding Mattermost-specific thread views.
For standup generation, prefer the focused reader instead of loading broad
`latest.md` directly:
```bash
python3 scripts/mattermost-proxy/read-context.py --mode standup --today YYYY-MM-DD
```
`standup` mode reads only date-bucketed records for the previous workday and
today. To avoid spending tokens on unrelated channels or stale global `latest.md`
content, configure project-specific context channels in the connector-local
`.env` or pass them explicitly. Keep those channel values out of reusable scripts.
```bash
AIW_MATTERMOST_CONTEXT_CHANNELS="project-main,project-standup,dm-you--manager" \
python3 scripts/mattermost-proxy/read-context.py --mode standup --today YYYY-MM-DD
python3 scripts/mattermost-proxy/read-context.py --mode standup --today YYYY-MM-DD \
--channels "project-main,project-standup,dm-you--manager"
```
If no context channel filter is configured, `standup` mode still avoids
`latest.md` and reads date-bucketed records only, but it will include all mirrored
channels for those dates.
Direct-message channels are labeled as `dm-<user-a>--<user-b>` when the mirror
has seen enough user metadata to resolve the Mattermost channel ID. Group DMs
use `group-...`. If a DM was first captured before the relevant user metadata
@@ -119,6 +143,7 @@ Each line in the normalized JSONL contains:
- `MATTERMOST_MIRROR_CHANNEL_IDS`: optional comma-separated channel ID allowlist.
- `MATTERMOST_MIRROR_WRITE_RAW`: set to `1` to save compact raw REST/WebSocket evidence.
- `MATTERMOST_APP_PATH`: Mattermost Desktop `.app` bundle path.
- `AIW_MATTERMOST_PROJECT_CHANNELS`: optional comma-separated channel names or IDs for focused standup reads.
## Troubleshooting