9 Commits

Author SHA1 Message Date
tinkle-community
1851508353 feat(agent): make the assistant agentic - visible tools, LLM voice, full toolset
The agent felt like an artificial idiot because the LLM almost never spoke
for itself: 14+ Go paths injected fmt.Sprintf canned replies, the frontend
filtered out tool-progress events so users saw three dots for 10-20s, the
main prompt told the LLM "be a trading partner" AND "answer only what's
asked", and the planner sliced the toolset by inferred domain so a "BTC
dropped, how much am I losing?" question couldn't see positions and market
at the same time.

- agent/central_brain.go: shouldTrustDeterministicSkillReply now always
  returns false. Successful mutations (trader/strategy/model/exchange
  create/update/start/stop/delete) flow through reviewTaskCompletion so the
  LLM sees the real outcome JSON and writes the user-facing prose. The
  trade-confirmation regex path (handleTradeConfirmation) was already
  outside this code path and is unaffected.

- agent/agent.go: rewrite the Behavior section of the main system prompt.
  Replace the contradictory "answer only what's asked / don't upsell" with
  "lead with the direct answer, then optionally one relevant follow-up
  only when (a) open risk, (b) missing config, or (c) the next step is
  obvious — e.g. created, want me to start it?". Explicitly authorize
  chaining ("if the user says create and start, do both this turn") and
  ban "please wait / I'll get back to you" language because there is no
  background job to come back from.

- agent/tools.go: plannerToolsForText always returns the full 22-tool set
  (new __all__ domain). The old per-domain trimming hid manage_trader from
  market questions and execute_trade from anything that didn't look like
  an explicit trade — cross-domain reasoning was structurally blocked. The
  compact-vs-full strategy schema switch is preserved so mutation intents
  still see the full config schema.

- web/src/components/agent/{AgentStepPanel,ChatMessages}.tsx: stop
  filtering tool: steps. Map raw tool names to friendly labels with emoji
  ("get_positions" → "📊 检查持仓") in zh/en/id. Users now see what the
  agent is doing in real time instead of silence. central_brain routing
  chatter still gets dropped.

- agent/planner_tools_test.go: tests updated to assert the new
  full-toolset behavior and the compact-vs-full strategy schema switch.
2026-05-29 22:13:05 +08:00
lky-spec
e67a927a4f Refine strategy creation flow and diagnostics 2026-05-09 14:48:24 +08:00
lky-spec
0f11be77f8 Improve NOFXi agent strategy creation flow 2026-05-06 17:00:05 +08:00
lky-spec
25d0b30ea9 Split strategy config by strategy type 2026-04-28 20:19:24 +08:00
lky-spec
2d45e7ab15 Refine agent strategy routing and config handling 2026-04-28 19:37:44 +08:00
lky-spec
e8eafce1e0 Require explicit agent mutation targets 2026-04-26 22:38:16 +08:00
lky-spec
ce3a8582af Simplify agent skill routing and config updates 2026-04-26 22:22:12 +08:00
lky-spec
903eb591eb Improve active skill schema handling 2026-04-26 11:58:29 +08:00
lky-spec
c244e4cdf1 change v1 2026-04-25 16:18:45 +08:00