File tree Expand file tree Collapse file tree
hindsight-integrations/coding-agents/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ describe("buildHookOutput", () => {
152152 expect ( client . reflect ) . toHaveBeenCalledTimes ( 1 ) ;
153153 } ) ;
154154
155- it ( "caps the reflect timeout at 25000ms even when config asks for more " , async ( ) => {
155+ it ( "uses a bounded low-budget reflect and caps its timeout at 25000ms " , async ( ) => {
156156 const cfg = resolveConfig ( { } ) ; // reflectTimeoutMs default 120000
157157 const client = makeClient ( ) ;
158158 await buildHookOutput ( {
@@ -163,7 +163,7 @@ describe("buildHookOutput", () => {
163163 cacheFile,
164164 } ) ;
165165 expect ( client . reflect ) . toHaveBeenCalledWith ( buildReflectQuery ( "the prompt" ) , {
166- budget : "high " ,
166+ budget : "low " ,
167167 timeoutMs : 25000 ,
168168 } ) ;
169169 } ) ;
@@ -179,7 +179,7 @@ describe("buildHookOutput", () => {
179179 cacheFile,
180180 } ) ;
181181 expect ( client . reflect ) . toHaveBeenCalledWith ( buildReflectQuery ( "the prompt" ) , {
182- budget : "high " ,
182+ budget : "low " ,
183183 timeoutMs : 5000 ,
184184 } ) ;
185185 } ) ;
Original file line number Diff line number Diff line change @@ -112,7 +112,10 @@ export async function buildHookOutput(args: {
112112 const t0 = Date . now ( ) ;
113113 try {
114114 reflectAnswer = await client . reflect ( buildReflectQuery ( prompt ) , {
115- budget : "high" ,
115+ // Automatic reflection runs inside a hard 25s hook window. Hindsight's low budget is the
116+ // supported default for bounded reflect calls; callers that explicitly invoke the MCP
117+ // tool still get the deeper high-budget path.
118+ budget : "low" ,
116119 timeoutMs : Math . min ( cfg . reflectTimeoutMs , HOOK_REFLECT_CAP_MS ) ,
117120 } ) ;
118121 diag ( harness , reflectAnswer ? "reflect_ok" : "reflect_empty" , {
You can’t perform that action at this time.
0 commit comments