thinkAndAct/thinkAndActStream now try the native function-calling loop
first for fresh conversations; in-flight legacy flows (skill sessions,
workflows, execution states, pending proposals) stay on the legacy stack
until they finish. NOFX_AGENT_V2=off restores the old routing entirely.
Clarify the rationale for not injecting conversation history in the
legacy loop comment, and extract plannerToolDomainForText result into
a named variable for readability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove conversation history injection from thinkAndActLegacyWithStore.
Previously, the legacy loop appended all prior Q&A turns, causing the
LLM to re-answer topics from earlier conversations (e.g. strategy data
leaking into a wallet balance question). Each legacy-loop call is now
treated as a standalone request with domain-filtered tools.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: when planner fails (402 payment), legacy loop dumps all system
context to LLM which outputs everything. Also final response prompt was too
weak — LLM treated all observations as required output.
Changes:
- Strengthen system prompt: "answer ONLY what user asked", no tables/tutorials
unless requested, no self-intro repeats, no "next step" suggestions
- Add compact observation summary for final response (step summaries only,
no raw JSON blobs)
- Domain-filtered tool selection in legacy loop to prevent over-fetching
- Fix domain routing: "钱包/wallet" → account domain (not model), with
exchange configs included for wallet context
- Widen wallet fast-path: no longer requires "claw402" keyword
- Anti-repetition instructions in planner step selector
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Agent now uses mcp.NewAIClientByProvider() for claw402 provider, ensuring
x402 payment signing works correctly instead of generic HTTP client
- Added ReasoningContent field to Message/LLMResponse structs and wired
serialization/parsing so DeepSeek thinking models work in multi-turn
- Added Beta badge to Agent nav tab in HeaderBar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add nil checks for session.TargetRef in all four execute*Action
handlers (Trader/Exchange/Model/Strategy) to prevent panic on
corrupted sessions; bulk-delete and query actions are excluded
- Add ensureHistory() helper and call it in runPlannedAgentWithContextMode
to prevent nil panic when history is not initialized
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add stopCh check in runPostResponseMaintenanceAsync to respect agent
shutdown, preventing goroutine leak on Agent.Stop()
- Replace bare context.Background() in handleTraderDiagnosisSkill with
a 30s timeout context for proper deadline propagation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>