[feedback] Add source info into feedback metadata. (#7140)

Verified the source info is correctly attached based on whether it's cli
or vscode.
This commit is contained in:
Matthew Zeng
2025-11-24 11:05:37 -08:00
committed by GitHub
parent 35d89e820f
commit c31663d745
5 changed files with 36 additions and 0 deletions

View File

@@ -1131,6 +1131,29 @@ pub enum SubAgentSource {
Other(String),
}
impl fmt::Display for SessionSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
SessionSource::Cli => f.write_str("cli"),
SessionSource::VSCode => f.write_str("vscode"),
SessionSource::Exec => f.write_str("exec"),
SessionSource::Mcp => f.write_str("mcp"),
SessionSource::SubAgent(sub_source) => write!(f, "subagent_{sub_source}"),
SessionSource::Unknown => f.write_str("unknown"),
}
}
}
impl fmt::Display for SubAgentSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
SubAgentSource::Review => f.write_str("review"),
SubAgentSource::Compact => f.write_str("compact"),
SubAgentSource::Other(other) => f.write_str(other),
}
}
}
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, TS)]
pub struct SessionMeta {
pub id: ConversationId,