WeKnora/internal/agent
wizardchen 439443e1e1 feat(agent): tell session agents which workspace they are working in
The installer agent was recently given its working directory up front and
stopped prefixing `cd <skill-dir> &&` onto every command. Session agents
never got the same treatment: shell_exec only mentioned /workspace as the
work_dir default, so the model could not tell it was already there, and
execute_skill_script never said scripts run with /workspace as their cwd —
a relative path inside a skill script silently resolves outside the skill.

Describe the workspace once, where each tool is described: shell_exec gains
a Working Directory section (already in /workspace, relative paths, no `cd`
prefix, and each call starts there again so a `cd` does not carry over),
execute_skill_script states its cwd and points at $WEKNORA_SKILL_DIR, and
the skills prompt gains a Workspace section covering input, output and the
per-session package overlay.

Also drop the installer prompt's paragraph about write_sandbox_file and
friends: those tools are not registered in install mode, so the model never
sees them in its schema and the note only spent tokens describing — and
misdescribing — a scope it could not reach.
2026-09-02 16:16:52 +08:00
..
approval refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
memory feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
skills refactor(skills): improve skill bundle size management and nginx configuration 2026-09-02 15:08:05 +08:00
token feat(agent): enhance message consolidation and context management 2026-03-25 22:08:29 +08:00
tools feat(agent): tell session agents which workspace they are working in 2026-09-02 16:16:52 +08:00
act.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
const.go feat(agent): keep max completion tokens as default or a custom cap 2026-08-30 10:52:17 +08:00
const_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
engine.go feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +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 feat(agent): keep max completion tokens as default or a custom cap 2026-08-30 10:52:17 +08:00
finalize.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
finalize_image_requirement_test.go fix(chat): enforce retrieved image output in answers 2026-07-15 18:10:31 +08:00
image_requirement.go fix(chat): enforce retrieved image output in answers 2026-07-15 18:10:31 +08:00
langfuse_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
observe.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
observe_test.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
prompts.go feat(agent): tell session agents which workspace they are working in 2026-09-02 16:16:52 +08:00
prompts_shell_test.go feat(agent): tell session agents which workspace they are working in 2026-09-02 16:16:52 +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
think.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
turn_usage_test.go feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00