WeKnora/internal/agent
nullptr-error fbaff900a0
feat(chat): append messages to a running agent turn (#3123)
* feat(stream): persist live-run markers and per-run steer queues

Mid-run sends need a cross-replica pointer to the generating
assistant and a control-plane list that never hits the SSE stream.

* feat(agent): inject queued user messages at ReAct round boundaries

The engine drains the steer sink after each round, persists accepted
rows, and delays Done until after a loop-end inject so the turn can continue.

* feat(session): expose /steer and hand leftover messages to a follow-up turn

Owner-scoped steer routes queue or inject into the live run, single-flight
AgentQA via the live-run marker, and history replay keeps multiple user rows
inside one turn.

* feat(frontend): queue mid-run messages while an agent turn streams

Stop and Send stay visible together, the overlay follows server delivery,
and history splits the transcript around injected user bubbles.

* fix(frontend): type pending and client_id on SteerQueueItem

vue-tsc failed because the overlay sets those fields while POST /steer is in flight.

* fix(session): harden steer persist, handoff, and new_run

Keep SetLiveRun ahead of SSE and roll back orphan turns, make inject
persist idempotent, append-then-delete on rebind, cap overrun rounds,
and stop aborting a live stream when /steer returns new_run.

* fix(session): satisfy pre-push lint on steer paths

Wrap long lines, check discarded Error/Emit results, and keep
context as the first argument so the fork push hook can pass.

---------

Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-09 16:43:33 +08:00
..
approval refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +08:00
compaction feat(agent): unify sandbox tools and drop host preloaded skills (#3033) 2026-09-05 16:45:59 +08:00
skills fix(skills): accept UTF-8 BOM in skill manifests 2026-09-09 14:42:03 +08:00
token feat(agent): keep long sandbox turns from truncating, overflowing, or rewriting files 2026-09-02 22:09:09 +08:00
tools fix(mcp): normalize JSON-encoded argument envelopes 2026-09-09 16:11:52 +08:00
act.go refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +08:00
act_order_test.go feat(agent): unify sandbox tools and drop host preloaded skills (#3033) 2026-09-05 16:45:59 +08:00
const.go fix(chat): send one completion-token field per provider (#3082) 2026-09-07 19:16:27 +08:00
const_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
context_debug.go feat(agent): keep long sandbox turns from truncating, overflowing, or rewriting files 2026-09-02 22:09:09 +08:00
engine.go feat(chat): append messages to a running agent turn (#3123) 2026-09-09 16:43:33 +08:00
engine_image_test.go feat: auto-describe MCP tool result images via VLM 2026-03-25 21:38:15 +08:00
engine_memory_test.go feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
engine_test.go fix(chat): send one completion-token field per provider (#3082) 2026-09-07 19:16:27 +08:00
finalize.go fix(chat): send one completion-token field per provider (#3082) 2026-09-07 19:16:27 +08:00
finalize_image_requirement_test.go fix(chat): enforce retrieved image output in answers 2026-07-15 18:10:31 +08:00
grounding_prompt.go feat(mcp)!: streamline setup and use short routing handles 2026-09-09 16:11:52 +08:00
grounding_prompt_test.go feat(agent): unify sandbox tools and drop host preloaded skills (#3033) 2026-09-05 16:45:59 +08:00
image_requirement.go feat(chat): keep prompt prefixes stable and send provider cache markers 2026-09-03 00:45:52 +08:00
langfuse_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
mcp_exposure_test.go fix(mcp): normalize JSON-encoded argument envelopes 2026-09-09 16:11:52 +08:00
mcp_proxy_test.go fix(mcp): normalize JSON-encoded argument envelopes 2026-09-09 16:11:52 +08:00
observe.go feat(chat): append messages to a running agent turn (#3123) 2026-09-09 16:43:33 +08:00
observe_test.go refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +08:00
prompts.go refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +08:00
prompts_shell_test.go feat(agent): unify sandbox tools and drop host preloaded skills (#3033) 2026-09-05 16:45:59 +08:00
prompts_wiki.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
prompts_wiki_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
steer.go feat(chat): append messages to a running agent turn (#3123) 2026-09-09 16:43:33 +08:00
steer_test.go feat(chat): append messages to a running agent turn (#3123) 2026-09-09 16:43:33 +08:00
think.go fix(chat): send one completion-token field per provider (#3082) 2026-09-07 19:16:27 +08:00
turn_usage_test.go feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00