Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: Claude Stop-hook continuations no longer hide the answer #27747

MergedAppLoidx(GitHub profile, opens in a new tab)merged 29 commits intomain fromrefs/pull/27747/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 146 additions and 11 deletions.

x
0 of 2 viewed, 2 left
74 additions and 1 deletionapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -27343,7 +27343,7 @@
session_id: WAKE_NATIVE_SESSION,
- const stopHookFeedback = (uuid: string, condition: string, reason: string) =>
+ const stopHookFeedback = (uuid: string | undefined, condition: string, reason: string) =>
claudeSdkFrame({
type: "user",
message: {
@@ -27362,6 +27362,78 @@
+ // Keyed by item id, so two notices that share an id count once.
+ const stopHookEffects = (events: ReadonlyArray<ProviderAdapter.ProviderAdapterV2Event>) => [
+ ...new Map(
+ events.flatMap((event) =>
+ event.type !== "turn_item.updated"
+ ? []
+ : event.turnItem.type === "notification"
+ ? [
+ event.turnItem.id,
+ `${event.turnItem.summary}: ${event.turnItem.detail}`,
+ ] as const,
+ : event.turnItem.type === "assistant_message" &&
+ event.turnItem.phase === "final_answer"
+ ? [[event.turnItem.id, `final answer: ${event.turnItem.text}`] as const]