list_active_context_objects tool #98
Labels
No labels
bug
duplicate
enhancement
invalid
question
research needed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
skobkin/telegram-ollama-reply-bot#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PRD: list_active_context_objects
Summary
Implement a deterministic tool that returns a compact list of currently active conversational objects for the current scope. “Active” does not mean “mentioned somewhere recently”; it means the object was explicitly touched by a meaningful bot/user interaction and is still relevant within a bounded TTL and scope. The purpose is to support safe follow-up flows without confusing the model with unrelated recent items.
Goal
Provide a compact, scoped snapshot of objects that are currently good candidates for follow-up actions or follow-up questions.
Non-goals
Why
The bot will support active articles, media handling, reminders, polls, summaries, and similar flows. Follow-up interactions need a compact way to know what objects are “live” in the current conversational scope without scanning raw history.
Definition of active
An object becomes active only through explicit activation events, not by mere mention.
Examples of activation events
Examples of non-activation
Supported object kinds
Scope rules
The listing must be scoped in this priority order:
The tool must strongly prefer same-topic activity in supergroups with topics.
Inputs
Conceptual request fields:
State model
The tool reads from in-memory indexed state only.
Each stored object should be associated with:
TTL guidance
Use per-kind TTLs so activity decays naturally:
The exact durations should be configurable, not hardcoded.
Output
Return a compact ordered list of active objects, not raw history.
Suggested output shape
Each returned object should include:
Ranking
Rank objects using deterministic rules:
Reason codes
Examples:
Behavior requirements
Important design rule
This tool is for contextual awareness, not final target selection.
If the caller needs a single best target, it should call resolve_reference_target after or instead of this tool.
When to use
Good use cases:
Bad use cases:
Edge cases
Implementation notes
Observability
Log compactly:
Tests
Must include focused tests for:
Acceptance criteria
Caused by #92 and #95, related to #97