@@ -2410,9 +2410,7 @@ function buildAdeInlineGuidanceForLane(laneWorktreePath: string | null | undefin
24102410 return buildAdeCliInlineGuidance ( getAdeAgentSkillRootsForPrompt ( { cwd : laneWorktreePath ?? undefined } ) ) ;
24112411}
24122412
2413- function resolveRunContextLaneId ( runtime : AdeRuntime , callerCtx : CallerContext ) : string | null {
2414- void runtime ;
2415- void callerCtx ;
2413+ function resolveRunContextLaneId ( _runtime : AdeRuntime , _callerCtx : CallerContext ) : string | null {
24162414 return null ;
24172415}
24182416
@@ -2864,12 +2862,8 @@ async function resolveEffectiveCallerContext(
28642862 return callerCtx ;
28652863}
28662864
2867- function isStandaloneChatCaller ( callerCtx : CallerContext ) : boolean {
2868- return callerCtx . standaloneChatSession ;
2869- }
2870-
28712865function isToolHiddenForStandaloneChat ( name : string , callerCtx : CallerContext ) : boolean {
2872- return isStandaloneChatCaller ( callerCtx ) && STANDALONE_CHAT_HIDDEN_TOOL_NAMES . has ( name ) ;
2866+ return callerCtx . standaloneChatSession && STANDALONE_CHAT_HIDDEN_TOOL_NAMES . has ( name ) ;
28732867}
28742868
28752869function isLocalComputerUseAllowed ( callerCtx : CallerContext ) : boolean {
@@ -2922,8 +2916,7 @@ async function listToolSpecsForSession(runtime: AdeRuntime, session: SessionStat
29222916 return allVisibleTools . filter ( ( tool ) => ! isToolHiddenForStandaloneChat ( tool . name , callerCtx ) ) ;
29232917}
29242918
2925- function parseInitializeIdentity ( runtime : AdeRuntime , params : unknown ) : SessionIdentity {
2926- void runtime ;
2919+ function parseInitializeIdentity ( _runtime : AdeRuntime , params : unknown ) : SessionIdentity {
29272920 const data = safeObject ( params ) ;
29282921 const identity = safeObject ( data . identity ) ;
29292922 const envContext = resolveEnvCallerContext ( ) ;
@@ -3094,7 +3087,6 @@ async function buildLaneStatus(runtime: AdeRuntime, laneId: string): Promise<Rec
30943087 } ;
30953088}
30963089
3097-
30983090// Global ask_user rate limit shared across all sessions to prevent
30993091// bypass via session recycling. Limits to 20 calls per 60s globally.
31003092const GLOBAL_ASK_USER_RATE_LIMIT = {
@@ -3217,9 +3209,7 @@ async function runTool(args: {
32173209 title : args . title ,
32183210 path : args . artifactPath ,
32193211 mimeType : args . mimeType ,
3220- metadata : {
3221- ...args . metadata ,
3222- } ,
3212+ metadata : args . metadata ,
32233213 } ,
32243214 ] ,
32253215 owners : resolveComputerUseOwners ( args . sessionState , args . toolArgs ) ,
@@ -3602,14 +3592,17 @@ async function runTool(args: {
36023592 const argsList = Array . isArray ( toolArgs . argsList ) ? toolArgs . argsList : null ;
36033593 const hasScalarArg = Object . prototype . hasOwnProperty . call ( toolArgs , "arg" ) ;
36043594 const rawObjectArgs = safeObject ( toolArgs . args ) ;
3605- const result = argsList
3606- ? await ( callable as ( ...params : unknown [ ] ) => Promise < unknown > ) . apply ( service , argsList )
3607- : hasScalarArg
3608- ? await ( callable as ( arg : unknown ) => Promise < unknown > ) . call ( service , toolArgs . arg )
3609- : await ( callable as ( args ?: Record < string , unknown > ) => Promise < unknown > ) . call (
3610- service ,
3611- Object . keys ( rawObjectArgs ) . length > 0 ? rawObjectArgs : undefined
3612- ) ;
3595+ let result : unknown ;
3596+ if ( argsList ) {
3597+ result = await ( callable as ( ...params : unknown [ ] ) => Promise < unknown > ) . apply ( service , argsList ) ;
3598+ } else if ( hasScalarArg ) {
3599+ result = await ( callable as ( arg : unknown ) => Promise < unknown > ) . call ( service , toolArgs . arg ) ;
3600+ } else {
3601+ result = await ( callable as ( args ?: Record < string , unknown > ) => Promise < unknown > ) . call (
3602+ service ,
3603+ Object . keys ( rawObjectArgs ) . length > 0 ? rawObjectArgs : undefined ,
3604+ ) ;
3605+ }
36133606 const record = isRecord ( result ) ? result : null ;
36143607 const statusHints = {
36153608 operationId : typeof record ?. operationId === "string" ? record . operationId : null ,
@@ -4076,11 +4069,10 @@ async function runTool(args: {
40764069 } ) ;
40774070 }
40784071 const answered = result . decision !== "decline" && result . decision !== "cancel" ;
4079- const outcome = result . decision === "decline"
4080- ? "declined"
4081- : result . decision === "cancel"
4082- ? "cancelled"
4083- : "answered" ;
4072+ let outcome : "answered" | "declined" | "cancelled" ;
4073+ if ( result . decision === "decline" ) outcome = "declined" ;
4074+ else if ( result . decision === "cancel" ) outcome = "cancelled" ;
4075+ else outcome = "answered" ;
40844076 return buildAskUserResult ( {
40854077 awaitingUserResponse : false ,
40864078 blocking : false ,
0 commit comments