Fix interactive lifecycle and resume history

This commit is contained in:
0xallam
2026-04-26 12:26:48 -07:00
parent 4a708fa00b
commit 383c7e02dd
4 changed files with 152 additions and 17 deletions
+5 -5
View File
@@ -236,11 +236,11 @@ def build_strix_agent(
instructions=instructions,
tools=tools,
tool_use_behavior=_finish_tool_use_behavior,
# Autonomous Strix runs must keep forcing tool calls after each
# tool result; otherwise the SDK resets tool_choice to auto and a
# plain-text model response can become final output before
# finish_scan / agent_finish.
reset_tool_choice=False,
# Non-interactive runs must keep forcing tool calls until the
# lifecycle tool completes. Interactive runs need the SDK default
# reset so a tool-assisted answer can end as plain text instead of
# looping through think/list_todos forever.
reset_tool_choice=interactive,
# model=None so ``RunConfig.model`` drives provider selection
# via :func:`build_multi_provider` rather than the SDK's default.
model=None,
+4 -1
View File
@@ -30,6 +30,9 @@ INTERACTIVE BEHAVIOR:
- EVERY message while working MUST contain exactly one tool call — this is what keeps execution moving. No tool call = execution stops.
- You may include brief explanatory text BEFORE the tool call
- Respond naturally when the user asks questions or gives instructions
- For simple conversation, acknowledgements, or direct questions that you can answer from current context, reply in plain text and stop. Do NOT call think just to prepare wording.
- If you use a tool to answer a user question (for example list_todos, view_agent_graph, or a file read), then after the tool result arrives, provide the answer in plain text and stop unless the user explicitly asked you to continue working.
- Never loop through think or other tools just to prepare, polish, confirm, or announce a final answer. Once you know the answer, say it.
- NEVER send empty messages — if you have nothing to do or say, call the wait_for_message tool
- If you catch yourself about to describe multiple steps without a tool call, STOP and call the think tool instead
{% else %}
@@ -149,7 +152,7 @@ OPERATIONAL PRINCIPLES:
- Use custom Python or shell code when you want to dig deeper, automate custom workflows, batch operations, triage results, build target-specific validation, or do work that existing tools do not cover cleanly
- Chain related weaknesses when needed to demonstrate real impact
- Consider business logic and context in validation
- NEVER skip think tool - it's your most important tool for reasoning and success
- Use think for non-trivial planning, uncertainty, multi-step security work, or choosing what to do next. Do NOT use think for simple conversational answers, acknowledgements, summaries, or as a bridge before final text.
- WORK METHODICALLY - Don't stop at shallow checks when deeper in-scope validation is warranted
- Continue iterating until the most promising in-scope vectors have been properly assessed
- Try multiple approaches simultaneously - don't wait for one to fail