Files
fidelity-ai-workspace/.agents/workflows/latest-message.md

2.1 KiB

description
description
Force-sync Mattermost and answer from the latest matching message

Refresh/read Mattermost first, then answer the user's question from the freshest evidence. Prefer the local proxy mirror when it is present; legacy sync output is fallback evidence.

Use this when the user asks for:

  • the latest or last message
  • what Jeff or another person just said
  • the latest Mattermost update
  • the latest message in fidelity-preguntas

Run sync/fallback refresh:

!start=$(date +%s); if [ -n "$AIW_MATTERMOST_SYNC_CMD" ]; then bash -lc "$AIW_MATTERMOST_SYNC_CMD"; elif [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No Mattermost sync command is configured."; fi; status=$?; end=$(date +%s); echo "__MATTERMOST_SYNC_SECONDS__=$((end - start))"; exit "$status"

Read a focused slice of refreshed Mattermost context, preferring the proxy mirror:

!python3 scripts/mattermost-proxy/read-context.py --mode focused

User request:

$ARGUMENTS

Instructions:

  • Do not answer from old conversation memory.
  • Use only the focused refreshed Mattermost output above.
  • If the user asks for the current manager/stakeholder, filter messages by the profile mapping when visible; for the Fidelity profile, also match jeff and jeff.dewitte.
  • If multiple messages match, return the newest matching message first.
  • Include timestamp, channel, sender, and concise summary.
  • Do not edit workspace memory in this command.
  • If the message appears to change project context, report it as a memory update candidate and name the likely target file.
  • Use /communication-sync or an explicit user request to promote the fact after the latest-message answer is complete.
  • If sync fails or no refreshed context is available, say that directly and do not infer from stale context.
  • If a write or patch attempt fails in this flow, stop immediately and return the latest-message answer plus the failed target; do not retry.

Return:

  1. Latest matching message
  2. Why it matters
  3. Memory update candidate, if any