Skip to content

Implement bounded Discord context loader for agent requests #269

Description

@michaelmwu

Parent: #265

Goal

Implement bounded Discord thread/channel context loading for agent requests.

Scope

  • Add a backend context loader interface with deterministic source adapters.
  • Implement a Discord current-thread/current-channel adapter.
  • Support max-message, max-age, and max-token bounds.
  • Return source-labeled snippets instead of anonymous raw text.
  • Treat loaded messages as untrusted data.
  • Do not implement global user-history search in the MVP.

Guardrails

  • Only load messages the actor is allowed to see.
  • Avoid loading private/restricted channels unless policy permits it.
  • Include enough metadata for audit: channel id, message ids, loader, bounds, and token count.
  • Do not store raw Discord message bodies indefinitely as part of this issue.

Acceptance criteria

  • The agent can receive recent current-thread context when authorized.
  • Loaded snippets are bounded and source-labeled.
  • Private/restricted context is blocked without the right policy decision.
  • Tests cover max bounds, source labeling, and denied access.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions