You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Migrate synthetic message detection to metadata-based approach #8766
Currently, copilot.ts detects synthetic user messages (compaction, tool attachments, subtasks) via regex pattern matching on message text. This works but has maintenance coupling.
Current State
synthetic: boolean already exists on TextPart (message-v2.ts:64)
It's already being set in various places (prompt.ts:1374, etc.)
BUT toModelMessage() does not propagate this flag to the final UIMessage
Proposed Change
In message-v2.tstoModelMessage():
Pass providerMetadata: { synthetic: true } for user text parts when part.synthetic === true
Add same metadata for compaction/subtask generated messages
In copilot.ts:
Check part.providerMetadata?.synthetic === true instead of pattern matching
Remove SYNTHETIC_PATTERNS array
Benefits
Type-safe detection (no string coupling)
Compile-time enforcement if field is renamed
Cleaner architecture
Eliminates theoretical "hackability" of pattern matching
Context
This is a follow-up to #8721 which implements the pattern-matching approach as a minimal fix.
Related issue: #8700 describes the specific problem (premium requests being burned when subagents create synthetic user messages) that this metadata-based approach aims to solve. You may want to cross-reference them for implementation context.
any chance we can adjust that compactions are not count towards premium requests with this ?
because in vscode copilot we are also able to run a single request for multiple hours (of course if good prompted with a spec) without getting additional premium requests used
Activity
github-actions commentedon Jan 16, 2026
Related issue: #8700 describes the specific problem (premium requests being burned when subagents create synthetic user messages) that this metadata-based approach aims to solve. You may want to cross-reference them for implementation context.
onedaxter commentedon Jan 23, 2026
any chance we can adjust that compactions are not count towards premium requests with this ?
because in vscode copilot we are also able to run a single request for multiple hours (of course if good prompted with a spec) without getting additional premium requests used
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
georgeharker commentedon Mar 27, 2026
My understanding is this is still an issue