fix(feedback): include session id in acknowledgement

This commit is contained in:
Turtle
2026-08-07 16:01:41 +08:00
parent a44009ec35
commit ef35c7f3b2
6 changed files with 17 additions and 10 deletions

View File

@@ -41,14 +41,18 @@ export function recordFeedback(session: Session, text: string): void {
* Validate, record, and acknowledge one feedback entry. Returning an error
* leaves no `feedback/record` event.
* @param invocation - receiving agent, raw command input, and UI cancellation.
* @returns an acknowledgement, or a usage error when no feedback text was supplied.
* @returns an acknowledgement containing the receiving session id, or a usage error
* when no feedback text was supplied.
*/
function executeFeedbackCommand(invocation: CommandInvocation): CommandResult {
if (invocation.rawInput.trim().length === 0) {
return { kind: 'error', text: `Feedback text is required. ${USAGE}` }
}
recordFeedback(invocation.agent.session, invocation.rawInput)
return { kind: 'success', text: 'Feedback recorded.' }
return {
kind: 'success',
text: `Feedback recorded for session ${invocation.agent.session.id}`,
}
}
/** Register the global `/feedback` command for every composed command adapter. */