WeKnora/internal/agent/skills
wizardchen 79995b996f fix(agent): scope the sandbox tools to the workspace they actually serve
Three inconsistencies in how the sandbox tools are granted and bounded.

Tool checkboxes that decide nothing. list/read/write/edit_sandbox_file,
shell_exec, read_skill and execute_skill_script were offered in the settings
UI, but registerSandboxFileTools, registerSandboxShellIfAllowed and
initializeSkillsManager all register from the capability (a sandbox with a
session filesystem, SkillsEnabled, install mode) and never consult
AllowedTools. Clearing a checkbox changed nothing. Drop them from
AvailableToolDefinitions the way search_memory and web_search already are,
so the switch that decides is the only thing shown.

Readers narrower than writers. write_sandbox_file accepts anything under
/workspace except the attachment tree, while list/read stopped at the
artifact output dir, so the agent could not read back the scratch script it
had just written and had to detour through `shell_exec cat`. Since
shell_exec reaches those files anyway the narrowing bought no safety; the
inspectable roots now cover /workspace, still ordered so a reported root
names the artifact or attachment tree when the path is inside one.

Two answers for one directory. A WEKNORA_SKILL_OUTPUT_DIR override was
validated on the execution path (falling back to /workspace/output) but
taken as-is from the host environment by the tools and ArtifactCollector, so
an override outside /workspace pointed the readers at a directory no skill
could write. Both now go through sandbox.ValidatedSessionOutputDir.
2026-09-02 16:16:52 +08:00
..
testdata feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
env_resolver.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
env_resolver_test.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
integration_test.go feat: support agent skills 2026-02-04 20:08:49 +08:00
loader.go feat: adapt preloaded skills to smart-reasoning agent 2026-02-04 20:08:49 +08:00
manager.go fix(agent): scope the sandbox tools to the workspace they actually serve 2026-09-02 16:16:52 +08:00
skill.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
skill_frontmatter.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
skill_frontmatter_test.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
skills_test.go feat(agent): write workspace scripts and run them with installed skills 2026-08-29 22:45:18 +08:00
source.go feat(sandbox): expose tenant skill management over HTTP and in the console (#2789) 2026-08-25 11:28:12 +08:00
tenant_source.go refactor(skills): improve skill bundle size management and nginx configuration 2026-09-02 15:08:05 +08:00
tenant_source_test.go refactor(skills): improve skill bundle size management and nginx configuration 2026-09-02 15:08:05 +08:00