Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9cdfc6a
test(workspace): add first Core contracts for human review
YuZou-coding Sep 8, 2026
b3a9ab7
feat(workspace): add schema and safe SQLite migrations
YuZou-coding Sep 8, 2026
116a812
feat(workspace): enforce Core grants and task bindings
YuZou-coding Sep 8, 2026
ec4676e
feat(workspace): connect and freeze native folder selection
YuZou-coding Sep 8, 2026
7555cb1
docs(workspace): record native freeze manifest
YuZou-coding Sep 8, 2026
7796d4e
feat(workspace): apply authoritative request context
YuZou-coding Sep 8, 2026
840e193
feat(workspace): rebuild private subagent context
YuZou-coding Sep 8, 2026
2d455fc
test(workspace): verify subagent context boundaries
YuZou-coding Sep 8, 2026
2a40fdc
test(workspace): cover task resume and private specs
YuZou-coding Sep 8, 2026
db6b65b
feat(workspace): stop bound work on revoke
YuZou-coding Sep 8, 2026
9cdd94b
feat(workspace): add Work folder controls
YuZou-coding Sep 8, 2026
f465954
feat(workspace): publish Core API contracts and final checks
YuZou-coding Sep 8, 2026
bb46abd
docs(workspace): record NewWorkZone handoff
YuZou-coding Sep 8, 2026
69d4b60
docs(workspace): publish constrained handoff plan
YuZou-coding Sep 8, 2026
3caaeab
test(workspace): define remaining UI behavior contracts
YuZou-coding Sep 8, 2026
919277a
fix(workspace): isolate task folder UI state
YuZou-coding Sep 8, 2026
4e837c4
feat(workspace): complete UI and context parity gaps
YuZou-coding Sep 8, 2026
cc0984c
docs(workspace): plan frontend stability fixes
YuZou-coding Sep 9, 2026
008f44c
docs(workspace): detail stability execution steps
YuZou-coding Sep 9, 2026
d7ae925
test(workspace): cover host errors and manager lifetime
YuZou-coding Sep 9, 2026
d2e3578
fix(workspace): isolate manager state and host errors
YuZou-coding Sep 9, 2026
7e04900
docs(workspace): record stability verification
YuZou-coding Sep 9, 2026
e3cdca6
feat: add workspace authorization execution hook
YuZou-coding Sep 9, 2026
bf2d90b
test: define workspace operation authorization contracts
YuZou-coding Sep 9, 2026
a576163
feat: add core workspace file operations
YuZou-coding Sep 9, 2026
cff178a
test: expose workspace permission and operation replay gaps
YuZou-coding Sep 9, 2026
b76d18f
fix: enforce workspace read approval and terminal operation states
YuZou-coding Sep 9, 2026
1542434
test: expose workspace claim expiry and unsafe release
YuZou-coding Sep 9, 2026
69e4809
fix: retain one-shot workspace operation claims
YuZou-coding Sep 9, 2026
7bc81ff
docs: consolidate remaining workspace implementation scope
YuZou-coding Sep 9, 2026
752a6a7
feat: integrate workspace authorization and controlled file execution
YuZou-coding Sep 9, 2026
a2f1d55
test: finish workspace authorization verification
YuZou-coding Sep 10, 2026
c9d52b7
docs: record workspace verification hashes
YuZou-coding Sep 10, 2026
3a5181e
docs: correct workspace completion status and remaining gaps
YuZou-coding Sep 10, 2026
8f279db
feat: complete workspace authorization integration
YuZou-coding Sep 10, 2026
0d2cf70
docs: record final workspace verification freeze
YuZou-coding Sep 10, 2026
4d5e335
docs: fix freeze hash references
YuZou-coding Sep 10, 2026
1339da9
fix(workspace): finalize authorization and approval flows
YuZou-coding Sep 11, 2026
fa152fb
docs(workspace): record final remote handoff
YuZou-coding Sep 11, 2026
77f36de
Merge official main into feature/newWorkZone
YuZou-coding Sep 11, 2026
f8b9eb6
refactor: narrow workspace algorithm changes
YuZou-coding Sep 11, 2026
a4141a9
chore: remove workspace planning docs from PR
YuZou-coding Sep 11, 2026
a67353b
fix frontend workspace review feedback
YuZou-coding Sep 11, 2026
87f77a0
fix conversation activity row type preservation
YuZou-coding Sep 11, 2026
acbe39e
fix backend review feedback for local workspaces
YuZou-coding Sep 11, 2026
10a30c6
Merge upstream main into feature/newWorkZone
YuZou-coding Sep 11, 2026
ef3258d
fix: address PR 710 workspace review feedback
YuZou-coding Sep 12, 2026
dc1ad64
fix: complete PR 710 workspace capability and approval lifecycle
YuZou-coding Sep 14, 2026
2f6a634
fix: address workspace algorithm review
YuZou-coding Sep 14, 2026
84ae357
Merge upstream main to resolve PR 710 conflicts
YuZou-coding Sep 14, 2026
0ebf1f7
fix(workspace): align host-file authorization structure
YuZou-coding Sep 14, 2026
f689381
fix(workspace): support derived undeclared host-file metadata
YuZou-coding Sep 15, 2026
40cfa72
Merge upstream main to resolve PR 710 conflicts
YuZou-coding Sep 15, 2026
bbf382a
refactor(workspace): unify file tools and unbound approval policy
Yuang-Deng Sep 15, 2026
8320074
feat(chat): add directory-bound conversation projects
Yuang-Deng Sep 15, 2026
b30553a
Merge feature/newWorkZone and preserve project boundaries
Yuang-Deng Sep 15, 2026
e68294e
refactor(chat): retire metadata model selection and align tool rendering
Yuang-Deng Sep 15, 2026
f9486c7
Merge pull request #2 from Yuang-Deng/dya/workspace-filesystem-tools
Yuang-Deng Sep 15, 2026
3fc0f38
refactor(workspace): unify authorization and conversation file resources
Yuang-Deng Sep 15, 2026
c692c77
chore(workspace): update LazyLLM with CI lint fixes
Yuang-Deng Sep 15, 2026
2c39e0b
fix(workspace): gate host tools and preserve subagent grants
Yuang-Deng Sep 15, 2026
b615550
fix(workspace): scope host-file authorization to product policy
Yuang-Deng Sep 16, 2026
fc4aa0f
chore: pin LazyLLM to merged authorization implementation
Yuang-Deng Sep 16, 2026
50ff5ea
refactor(workspace): retire legacy Core file execution
Yuang-Deng Sep 16, 2026
264cf7b
fix(workspace): persist directory identity and classify inactive appr…
Yuang-Deng Sep 16, 2026
3e33d41
merge: resolve main conflicts for workspace PR 710
Yuang-Deng Sep 17, 2026
f7f193c
Merge remote-tracking branch 'origin/main' into dya/pr710-conflict-fix
Yuang-Deng Sep 17, 2026
dcae0e7
chore: update LazyLLM to latest main
Yuang-Deng Sep 17, 2026
b7ef9f4
fix: resolve Python lint failures in workspace integration
Yuang-Deng Sep 17, 2026
d998889
merge: preserve workspace behavior with conversation UX updates
Yuang-Deng Sep 17, 2026
9e09d48
fix(ci): resolve workspace regressions and Windows test failures
Yuang-Deng Sep 17, 2026
e064e0e
test(workspace): align concurrent approval check with idempotent deci…
Yuang-Deng Sep 17, 2026
de279e8
test(filesystem): normalize glob result paths across platforms
Yuang-Deng Sep 18, 2026
afcc8a4
Merge main into feature/newWorkZone and resolve integration conflicts
Yuang-Deng Sep 18, 2026
6b8d4d9
fix(chat): show tool approvals above the composer
Yuang-Deng Sep 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15, windows-2025]
defaults:
run:
shell: bash
permissions:
contents: read
steps:
Expand All @@ -347,6 +350,17 @@ jobs:
with:
python-version: '3.11'

- name: Install ripgrep
run: |
if ! command -v rg >/dev/null 2>&1; then
case "$RUNNER_OS" in
Linux) sudo apt-get update && sudo apt-get install -y ripgrep ;;
macOS) brew install ripgrep ;;
Windows) choco install ripgrep -y --no-progress ;;
esac
fi
rg --version

- name: Install deps + coverage tools
env:
CMAKE_POLICY_VERSION_MINIMUM: '3.5'
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "algorithm/lazyllm"]
path = algorithm/lazyllm
url = https://github.com/LazyAGI/LazyLLM.git
branch = main
url = https://github.com/YuZou-coding/LazyLLM.git
branch = codex/tool-host-access-lifecycle
2 changes: 1 addition & 1 deletion algorithm/lazyllm
Submodule lazyllm updated 45 files
+17 −4 docs/en/Best Practice/functionCall.md
+17 −4 docs/zh/Best Practice/functionCall.md
+156 −2 lazyllm/docs/tools/tool_agent.py
+0 −2 lazyllm/docs/tools/tool_sandbox.py
+18 −0 lazyllm/tools/__init__.py
+18 −0 lazyllm/tools/agent/__init__.py
+4 −11 lazyllm/tools/agent/base.py
+1 −1 lazyllm/tools/agent/code_interpreter.py
+0 −63 lazyllm/tools/agent/download_tool.py
+364 −154 lazyllm/tools/agent/file_tool.py
+118 −56 lazyllm/tools/agent/shell_tool.py
+7 −6 lazyllm/tools/agent/skill_manager.py
+1 −1 lazyllm/tools/agent/todo_tool.py
+144 −1 lazyllm/tools/agent/tool_runtime.py
+183 −68 lazyllm/tools/agent/toolsManager.py
+2 −0 lazyllm/tools/fs/client.py
+82 −0 lazyllm/tools/fs/supplier/feishu.py
+5 −0 lazyllm/tools/fs/supplier/googledrive.py
+51 −0 lazyllm/tools/fs/supplier/notion.py
+9 −9 lazyllm/tools/git/review/pre_analysis/agent_tools.py
+4 −4 lazyllm/tools/git/review/pre_analysis/arch_pipeline.py
+3 −1 lazyllm/tools/mcp/tool_adaptor.py
+1 −2 lazyllm/tools/sandbox/dummy_sandbox.py
+2 −0 lazyllm/tools/tools/search/arxiv_search.py
+3 −0 lazyllm/tools/tools/search/base.py
+2 −0 lazyllm/tools/tools/search/bing_search.py
+2 −0 lazyllm/tools/tools/search/bocha_search.py
+2 −0 lazyllm/tools/tools/search/google_search.py
+5 −0 lazyllm/tools/tools/search/sciverse_search.py
+2 −0 lazyllm/tools/tools/search/tavily_search.py
+2 −0 lazyllm/tools/tools/search/wikipedia_search.py
+6 −6 lazyllm/tools/writer/tools/base.py
+17 −8 lazyllm/tools/writer/tools/multimodal_tools.py
+4 −4 lazyllm/tools/writer/utils/artifact.py
+10 −10 tests/advanced_tests/Tools/test_skills.py
+24 −9 tests/basic_tests/Tools/test_agent_base.py
+5 −1 tests/basic_tests/Tools/test_agent_events.py
+214 −60 tests/basic_tests/Tools/test_build_in_agent_tools.py
+12 −0 tests/basic_tests/Tools/test_fs_local_paths.py
+612 −0 tests/basic_tests/Tools/test_host_file_lifecycle.py
+115 −0 tests/basic_tests/Tools/test_host_file_security_modes.py
+7 −0 tests/basic_tests/Tools/test_sandbox.py
+9 −1 tests/basic_tests/Tools/test_tool_failure_recovery.py
+30 −18 tests/basic_tests/Tools/test_tool_manager_scheduling.py
+5 −2 tests/basic_tests/Tools/test_tool_runtime.py
2 changes: 2 additions & 0 deletions algorithm/lazymind/chat/api/subagent_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async def run_subagent(
Optional[List[Dict[str, Any]]],
Body(description='Core-owned durable step snapshot used for resume'),
] = None,
workspace_execution: Annotated[Optional[Dict[str, Any]], Body(description='Core private execution identity')] = None,
):
from lazymind.chat.engine.subagent.runner import run_subagent_stream

Expand All @@ -45,6 +46,7 @@ async def run_subagent(
tools=tools,
task_spec=task_spec,
initial_steps=initial_steps,
workspace_execution=workspace_execution,
),
media_type='text/event-stream',
)
15 changes: 9 additions & 6 deletions algorithm/lazymind/chat/engine/agent_runtime/compactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _classify(tool_name: str) -> str:
)) or name.endswith('_search') or 'search' in name:
return 'search'
if any(token in name for token in (
'read_file', 'read_user_attachment', 'feishuwikifs_read', 'cat_file',
'read', 'read_file_resource', 'read_user_attachment', 'feishuwikifs_read', 'cat_file',
)) or name.endswith('_read') or name.endswith('.read') or name == 'read' \
or name.endswith('_read_file') or name.endswith('_read_with_references'):
return 'file'
Expand Down Expand Up @@ -235,7 +235,8 @@ def compact_file_result(tool_name: str, content: Any, observation: Any = None) -
if eof is not None:
lines.append(f'EOF: {bool(eof)}')
if next_offset is not None:
lines.append(f'Continue with read_file(target={locator!r}, offset={next_offset}).')
reader, argument = ('read', 'path') if tool_name == 'read' else ('read_file_resource', 'target')
lines.append(f'Continue with {reader}({argument}={locator!r}, offset={next_offset}).')
lines.append('Content excerpt:')
lines.append(_head_tail(body, head=500, tail=300))
return '\n'.join(lines), 'file_locator' if locator else 'file'
Expand Down Expand Up @@ -511,14 +512,15 @@ def format_spilled_tool_notice(
content: Any,
rel_path: str,
size_bytes: int,
workspace: str = '',
) -> str:
size_kb = size_bytes / 1024
lines = [
'[Large tool result offloaded to workspace]',
f'Tool: {tool_name or "tool"}',
f'File path (relative to workspace): {rel_path}',
f'File path: {os.path.join(workspace, rel_path) if workspace else rel_path}',
f'Size: {size_kb:.1f} KB',
'Use read_file on this path if you need more than the excerpt below.',
'Use read on this path if you need more than the excerpt below.',
]
lines.extend(_browser_spill_metadata(tool_name, content))
lines.extend([
Expand Down Expand Up @@ -548,7 +550,7 @@ def compact_or_spill_tool_result(
except Exception:
rel_path = None
if rel_path:
notice = format_spilled_tool_notice(tool_name, content, rel_path, size_bytes)
notice = format_spilled_tool_notice(tool_name, content, rel_path, size_bytes, workspace)
return notice, 'spill', before, estimate_tokens(notice), rel_path, size_bytes
if _file_result_details(tool_name, content, observation):
compacted, compactor, before_tokens, after_tokens = compact_tool_result(
Expand Down Expand Up @@ -583,7 +585,7 @@ def plan_tool_result_compaction(
)
rel_path = os.path.join('tool_spills', filename)
spill_bytes = len(spill_text.encode('utf-8', errors='replace'))
notice = format_spilled_tool_notice(tool_name, content, rel_path, spill_bytes)
notice = format_spilled_tool_notice(tool_name, content, rel_path, spill_bytes, workspace)
after = estimate_tokens(notice)
if after < before:
return ToolCompactionPlan(
Expand Down Expand Up @@ -645,6 +647,7 @@ def commit_tool_result_plan(
plan.original_content,
rel_path,
plan.spill_bytes,
workspace,
)
return ToolCompactionPlan(
notice,
Expand Down
9 changes: 9 additions & 0 deletions algorithm/lazymind/chat/engine/agent_runtime/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,22 @@ def create_agent(self, llm: Any, plan: AgentRunPlan) -> Any:
prompt=plan.prompt.system_prompt,
**kwargs,
)
trusted_opaque_tools = tuple(
tool for name in (getattr(agent, '_skill_tool_names', set()) & {'run_script'})
if (tool := agent._tools_manager.tools_info.get(name)) is not None
)
permission = options.workspace_permission
agent._tools_manager = ToolExecutionMiddleware(
CitationResultMiddleware(agent._tools_manager),
failure_policy=FailureRetryPolicy(options.tool_failure_limits),
expanded_round_limit=max(2, int(_cfg['agentic_expanded_max_rounds'])),
cancel_check=options.extra_stop_condition,
repeat_monitor=repeat_monitor,
notice_buffer=notice_buffer,
authorization_gate=options.authorization_gate,
workspace_permission=permission,
tool_context=options.tool_context,
trusted_opaque_tools=trusted_opaque_tools,
)
agent._agent_lab_run_id = run_id
agent._runtime_llm = llm
Expand Down
6 changes: 6 additions & 0 deletions algorithm/lazymind/chat/engine/agent_runtime/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from enum import Enum
from typing import Any, Callable, Literal, Optional, Tuple

from ..tools.workspace_context import ToolResolutionContext


class AgentRole(str, Enum):
CHAT = 'chat'
Expand Down Expand Up @@ -52,6 +54,10 @@ class AgentExecutionOptions:
llm_config: Optional[dict[str, Any]] = None
max_input_tokens: Optional[Any] = None
history_compactor: Optional[Callable[..., list[dict[str, Any]]]] = None
authorization_gate: Optional[Callable[..., Any]] = None
tool_configs: Optional[list[Any]] = None
workspace_permission: Any = None
tool_context: ToolResolutionContext | None = None


CompressionTrigger = Literal['pre_turn', 'mid_turn']
Expand Down
4 changes: 2 additions & 2 deletions algorithm/lazymind/chat/engine/agent_runtime/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
_PREVIEW_CHARS = 400

_FILE_READ_TOOLS = {
'read_file',
'read_file_resource',
'read_user_attachment',
'feishuwikifs_read',
'cat_file',
'LocalFileToolkit_read',
'read',
}
_HARNESS_TOOLS = {
'create_subagent',
Expand Down
Loading
Loading