ThreadDiscussion
ThreadDiscussionFields
The ID of the Plain thread this discussion is attached to. Null for global Sidekick agent sessions that were not started from a thread.
The support thread when threadId is set. Null when the discussion has no thread (e.g. some global Sidekick sessions).
Lifecycle of the discussion: OPEN until it is resolved, RESOLVED when resolvedAt is set. What the agent is doing is reported separately by agentStatus.
What the agent working on this discussion is doing. UNKNOWN when no agent is involved. Prefer this over status for anything agent-related: status is narrowing to OPEN / RESOLVED.
The agent that was asked. Null means Plain's Sidekick.
Timestamp of the most recent message in the discussion. Null when no messages have been posted yet.
True when the discussion has an unread agent response (set when a Sidekick agent session settles into IDLE, cleared when the session is opened / marked read).
Channel-specific details for the discussion (Slack channel info, email recipients, or agent session ID). The concrete type depends on the discussion type.
The Sidekick agent session backing this discussion, when it has one. Set for AGENT_SESSION discussions and for SLACK discussions started by a Sidekick mention, whose session is linked to the discussion rather than carried in channelDetails. Null for discussions with no agent session.
Who can see this discussion. WORKSPACE means visible to all workspace members, USER means visible only to the creator. Null when not yet set.
When the discussion was started from an entity page (company, tenant, etc.). Null when source is thread-only, a plain link, or absent.
The type of entity for sourceEntityId (e.g. COMPANY, TENANT). Null when sourceEntityId is not set.
What kind of source this discussion was started from (THREAD | PAGE | ENTITY | CHART). Null for older rows with no source.
The page path where this discussion was started (e.g. '/workspace/ws_xxx/insights'). Set for PAGE and CHART sources; null otherwise (older rows, or thread/entity-only context).
The page-fragment anchor (no '#') identifying the element the discussion was started from, e.g. a specific reporting chart. Kept separate from sourcePageLink, which is matched exactly as a page-scope key and must stay hash-free. Set only for PAGE and CHART sources; null otherwise.
User-authored messages that the user has submitted but the agent has not picked up yet because it was mid-turn. Empty for non-AGENT_SESSION discussions. Frontend can render these as greyed-out preview bubbles pinned to the bottom of the chat; they disappear when the agent picks them up (a real ThreadDiscussionMessage is created at that point with a correctly-ordered timestamp) or when the queue is cleared by error / timeout / manual stop.

