feat(telegram): attribute forwarded messages #37
No reviewers
Labels
No labels
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie!37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "sandcastle/issue-25"
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?
Summary
When a Telegram message is a forward, prepend a compact attribution prefix to its text before it reaches the pi pipeline, so the model knows where the content came from.
Format:
[Forwarded from <name>, YYYY-MM-DD]— or[Forwarded]when the origin has no displayable name (e.g. a nameless chat).What changed
format_forward_prefix(origin: &MessageOrigin)— maps all fourMessageOriginvariants (User, HiddenUser, Chat, Channel) to a human-readable attribution string with an ISO date.apply_forward_prefix(extraction, prefix)— prepends the prefix toExtraction::Contenttext; leavesUnhandledand other variants untouched.extract_message_contentnow wraps the renamedextract_message_content_raw, readingmsg.forward_origin()and applying the prefix in one place before returning.Key decisions
YYYY-MM-DDfor unambiguous, locale-neutral display.Reviewer checklist
MessageOriginarms are handled (confirm no future variants are expected by teloxide)Closes #25