Skip to content

Live badge shows on threads with agent-authored CLI replies, not just Send to Agent #262

@tomasz-tomczyk

Description

@tomasz-tomczyk

Bug

The "⚡ live" badge on comment threads appears whenever any reply has author === agentName, but it should only appear when the user explicitly used the "Send to Agent" button.

Reproduction

  1. Configure agent_cmd in crit config
  2. Use the plan hook flow — Claude replies to a comment via crit comment --reply-to <id> --author claude "..."
  3. The comment thread shows the "⚡ live" badge even though "Send to Agent" was never used

Root cause

isLiveThread() in app.js (line ~4285) uses a broad heuristic:

function isLiveThread(comment) {
    if (!agentEnabled || !comment.replies) return false;
    return comment.replies.some(function(r) { return r.author === agentName; });
}

This matches ANY reply from the agent, including CLI replies from plan review (crit comment --reply-to --author claude). It should only match threads where "Send to Agent" was explicitly used.

Impact

  • Threads incorrectly show as "live"
  • Replies in "live" threads auto-forward to the agent (line ~5127), so typing a reply in a falsely-live thread would unexpectedly trigger an agent request

Suggested fix

Persist an agent_requested flag on the comment when POST /api/agent/request is called. Then isLiveThread checks comment.agent_requested instead of checking reply authors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions