GoogleCloudPlatform / GoogleCloudPlatform/scion

feat(telegram): preserve reply/quote context in delivered messages

Open
#449 0 comments 0 reactions 0 assignees View on GitHub
area:chat type:feature
Dominant language
Go
Stars
1.7k
Forks
263
Avg merge
7h 6m
Merged PRs (30d)
447

Description

## Problem

When a user quotes/replies to a previous message in Telegram, the quoted context is lost in delivery to the agent. The agent only receives the new message text, not the referenced message.

Example: User replies to a message saying "Deploy the OAuth middleware" with "Status now?" — the agent receives only "Status now?" with no context about what the user is asking about.

## Current Behavior

The scion Telegram bridge delivers messages as:
```json
{
"msg": "Status now?",
"type": "instruction",
"channel": "telegram"
}
```

The `reply_to_message` field from Telegram's API is not included.

## Proposed Behavior

Include the quoted message content when available:
```json
{
"msg": "Status now?",
"type": "instruction",
"channel": "telegram",
"reply_to": {
"msg": "Deploy the OAuth middleware and fix the red team vulns",
"sender": "user:dev@localhost",
"timestamp": "2026-06-19T04:45:00Z"
}
}
```

This would let the agent understand what the user is referencing without requiring them to re-paste context.

## Impact

Without this, users must redundantly include context in every message. Telegram's reply feature is a natural UX pattern that currently breaks the agent's ability to follow the conversation.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the scion Telegram bridge's delivery handling and inspect how Telegram's reply_to_message field is mapped into the delivered JSON. Preserve the available quoted message content and metadata under reply_to, then verify that replied-to messages produce the proposed payload while ordinary messages remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.