Source symbols: agent.py
Deterministic, value-free symbol metadata extracted from public source. Implementations and literal values are not copied into this page.
- Revision: main@d1d48bc9c0e6e253e87c354ce757c518820c6e25 · 2026-07-20T15:04:19Z
- Declarations: 80
- Referenced calls: 141
Declared symbols
AgentContextType— class at line 45AgentContext— class at line 51__init__— def at line 59; referencesgenerate_id,get,pop,kill,set_currentget— def at line 108; referencesset_current,get_context_data,set_context_data,list,values,join,choices,generate_short_id,NotificationManager,pop,kill,serialize_datetime,fromtimestamp,len,is_runninguse— def at line 113; referencesget,set_current,get_context_data,set_context_data,list,values,join,choices,generate_short_id,NotificationManager,pop,kill,serialize_datetime,fromtimestamp,len,is_runningcurrent— def at line 122; referencesget_context_data,get,set_context_data,list,values,join,choices,generate_short_id,NotificationManager,pop,kill,serialize_datetime,fromtimestamp,len,is_runningset_current— def at line 129; referencesset_context_data,list,values,join,choices,generate_short_id,NotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runningfirst— def at line 133; referenceslist,values,join,choices,generate_short_id,NotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runningall— def at line 140; referenceslist,values,join,choices,generate_short_id,NotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runninggenerate_id— def at line 145; referencesjoin,choices,generate_short_id,NotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runninggenerate_short_id— def at line 146; referencesjoin,choices,NotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runningget_notification_manager— def at line 156; referencesNotificationManager,pop,kill,get,serialize_datetime,fromtimestamp,len,is_runningremove— def at line 165; referencespop,kill,get,serialize_datetime,fromtimestamp,len,is_runningget_data— def at line 172; referencesget,serialize_datetime,fromtimestamp,len,is_runningset_data— def at line 176; referencesget,serialize_datetime,fromtimestamp,len,is_runningget_output_data— def at line 180; referencesget,serialize_datetime,fromtimestamp,len,is_runningset_output_data— def at line 184; referencesget,serialize_datetime,fromtimestamp,len,is_runningoutput— def at line 189; referencesget,serialize_datetime,fromtimestamp,len,is_runninglog_to_all— def at line 214; referencesall,append,log,kill,kill_process,reset,Agent,communicate,UserMessage,read_prompt,is_alive,get_agent,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chainkill_process— def at line 233; referenceskill,reset,Agent,communicate,UserMessage,read_prompt,is_alive,get_agent,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asyncreset— def at line 238; referenceskill_process,Agent,communicate,UserMessage,read_prompt,is_alive,get_agent,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asyncnudge— def at line 246; referenceskill_process,communicate,UserMessage,read_prompt,is_alive,get_agent,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asyncget_agent— def at line 253; referencesis_alive,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asyncis_running— def at line 256; referencesis_alive,get_agent,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asynccommunicate— def at line 260; referencesget_agent,is_alive,get,run_task,DeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,_process_chain,call_extensions_asyncrun_task— def at line 280; referencesDeferredTask,start_task,hist_add_user_message,hist_add_tool_result,monologue,get,_process_chain,call_extensions_async,get_agent_process_chain— def at line 292; referenceshist_add_user_message,hist_add_tool_result,monologue,get,call_extensions_async,get_agenthandle_exception— def at line 314; referencesfield,OrderedDictAgentConfig— class at line 320; referencesfield,OrderedDictUserMessage— class at line 328; referencesfield,OrderedDictLoopData— class at line 335; referencesOrderedDict__init__— def at line 336; referencesOrderedDictAgent— class at line 355; referencesAgentContext,History__init__— def at line 365; referencesAgentContext,Historymonologue— def at line 387; referencesLoopData,call_extensions_async,PrintStylereasoning_callback— def at line 424; referenceshandle_intervention,printstream_callback— def at line 442; referenceshandle_intervention,printprepare_prompt— def at line 565; referencesset_progress,call_extensions_async,get_system_prompt,output,join,_build_context_message_build_context_message— def at line 624; referencesMessage,read_prompt,stringifyhandle_exception— def at line 643; referencescall_extensions_async,get_paths,parse_file,read_prompt_file,is_full_json_template,remove_code_fences,get,nowget_system_prompt— def at line 683; referencescall_extensions_async,get_paths,parse_file,read_prompt_file,is_full_json_template,remove_code_fences,get,nowparse_prompt— def at line 691; referencesget_paths,parse_file,read_prompt_file,is_full_json_template,remove_code_fences,get,nowread_prompt— def at line 700; referencesget_paths,read_prompt_file,is_full_json_template,remove_code_fences,get,nowget_data— def at line 708; referencesget,nowset_data— def at line 711; referencesget,nowhist_add_message— def at line 715; referencesget,nowhist_add_user_message— def at line 738; referencesnew_topic,parse_prompt,isinstance,itemshist_add_ai_response— def at line 767; referencesparse_prompt,hist_add_message,metadata_from_llm_result,pophist_add_warning— def at line 780; referencesparse_prompt,hist_add_message,pophist_add_tool_result— def at line 785; referencespopconcat_messages— def at line 810; referencesoutput_text,get_utility_modelget_chat_model— def at line 816; referencesget_utility_modelget_utility_model— def at line 820get_embedding_model— def at line 824; referencesget_utility_modelcall_utility_model— def at line 828; referencesget_utility_modelstream_callback— def at line 850; referencesunified_call,call_extensions_async,get_chat_modelcall_chat_model— def at line 870; referencesget_chat_modelcall_chat_model_turn— def at line 914; referencesget_chat_model,getattr_responses_state_for_model— def at line 1005; referencesget_data,isinstance_responses_input_items_since— def at line 1016; referencesmessages_since,extend,_responses_input_items_for_message,result_from_metadata,to_dict,dict,output,output_langchain,hasattr,_convert_messages,input_from_messages,get_data,isinstance,get,str,append,set_data_responses_input_items_for_message— def at line 1024; referencesresult_from_metadata,to_dict,dict,output,output_langchain,hasattr,_convert_messages,input_from_messages,get_data,isinstance,get,str,append,set_data_responses_prompt_input_items— def at line 1041; referenceshasattr,_convert_messages,input_from_messages,get_data,isinstance,get,str,append,set_data_remember_llm_result_state— def at line 1049; referencesget_data,isinstance,get,str,append,set_datarate_limiter_callback— def at line 1072; referencesset_progress,wait_if_paused,strip,hist_add_tool_result,hist_add_ai_response,hist_add_user_message,InterventionException,sleep,_log_response_builtin_items,get_data,original_tool_name,function_call_output_item,_execute_tool_request,json_parse_dirty,process_tools,get_instance,get_tool,PrintStyle,print,hist_add_warninghandle_intervention— def at line 1080; referenceswait_if_paused,strip,hist_add_tool_result,set_progress,hist_add_ai_response,hist_add_user_message,InterventionException,sleep,_log_response_builtin_items,get_data,original_tool_name,function_call_output_item,_execute_tool_request,json_parse_dirty,process_tools,get_instance,get_tool,PrintStyle,print,hist_add_warningwait_if_paused— def at line 1100; referencessleep,_log_response_builtin_items,get_data,original_tool_name,function_call_output_item,_execute_tool_request,json_parse_dirty,process_tools,get_instance,get_tool,PrintStyle,print,hist_add_warning,log,handle_intervention,before_execution,call_extensions_asyncprocess_llm_result_tools— def at line 1104; references_log_response_builtin_items,get_data,original_tool_name,function_call_output_item,_execute_tool_request,json_parse_dirty,process_tools,get_instance,get_tool,PrintStyle,print,hist_add_warning,log,handle_intervention,before_execution,call_extensions_async_execute_tool_request— def at line 1134; referencesget_instance,get_tool,PrintStyle,print,hist_add_warning,log,handle_intervention,before_execution,call_extensions_async_log_response_builtin_items— def at line 1225; references_handle_responses_computer_call,_handle_responses_mcp_approval_request,log,dumps,get,str_handle_responses_computer_call— def at line 1239; referencesget,str_handle_responses_mcp_approval_request— def at line 1295; referencesstr,get_computer_call_args— def at line 1319; referencesget,dict,isinstance_computer_call_output_item— def at line 1369; referencesstr,getattr_clear_responses_pending_state— def at line 1400; referencesget_data,isinstance,dict,pop,set_data,json_parse_dirtyprocess_tools— def at line 1409; referencesjson_parse_dirtyvalidate_tool_request— def at line 1515; referencesnormalize_tool_requesthandle_reasoning_stream— def at line 1520; referenceshandle_intervention,call_extensions_asynchandle_response_stream— def at line 1529; referenceshandle_intervention,len,parse_string,isinstance,call_extensions_asyncget_tool— def at line 1548; referencesget_paths,load_classes_from_file,tool_classre_search_session_id— def at line 1584; referencessearch,group
File-level call references
import— line 10RLock— line 54generate_id— line 76get— line 79pop— line 81kill— line 84set_current— line 86Log— line 93now— line 98Agent— line 105get_context_data— line 123set_context_data— line 130list— line 137values— line 137join— line 147choices— line 147generate_short_id— line 150NotificationManager— line 160serialize_datetime— line 194fromtimestamp— line 196len— line 200is_running— line 209all— line 224append— line 225log— line 226kill_process— line 239reset— line 240communicate— line 249UserMessage— line 249read_prompt— line 249is_alive— line 257get_agent— line 263run_task— line 275DeferredTask— line 284start_task— line 287hist_add_user_message— line 295hist_add_tool_result— line 297monologue— line 301_process_chain— line 304call_extensions_async— line 307handle_exception— line 311field— line 323OrderedDict— line 341items— line 351setattr— line 352AgentContext— line 373History— line 379call_extensions_sync— line 384LoopData— line 391PrintStyle— line 397handle_intervention— line 411prepare_prompt— line 415print— line 427stream— line 438handle_reasoning_stream— line 440extract_json_root_string— line 452json_parse_dirty— line 454validate_tool_request— line 457startswith— line 463handle_response_stream— line 479call_chat_model_turn— line 485hist_add_ai_response— line 510_remember_llm_result_state— line 515hist_add_warning— line 518process_llm_result_tools— line 534set_progress— line 566get_system_prompt— line 574output— line 575_build_context_message— line 586clear— line 598output_langchain— line 602SystemMessage— line 608from_messages— line 611format— line 611set_data— line 614approximate_prompt_tokens— line 618Message— line 634stringify— line 638get_paths— line 692parse_file— line 694read_prompt_file— line 703is_full_json_template— line 704remove_code_fences— line 705add_message— line 729new_topic— line 739parse_prompt— line 743isinstance— line 758hist_add_message— line 762metadata_from_llm_result— line 776output_text— line 813get_utility_model— line 835unified_call— line 854get_chat_model— line 881getattr— line 923build_responses_function_tools— line 926_responses_state_for_model— line 939int— line 941_responses_input_items_since— line 943_responses_prompt_input_items— line 947unified_turn— line 973str— line 991get_data— line 1006messages_since— line 1020extend— line 1021_responses_input_items_for_message— line 1021result_from_metadata— line 1027to_dict— line 1030dict— line 1032hasattr— line 1036_convert_messages— line 1037input_from_messages— line 1038wait_if_paused— line 1081strip— line 1090InterventionException— line 1098sleep— line 1102_log_response_builtin_items— line 1105original_tool_name— line 1109function_call_output_item— line 1110_execute_tool_request— line 1114process_tools— line 1132
Source: agent.py