fix: tools plugin uses workspace path instead of cwd (#174) #175

Merged
k9ert merged 1 commit from fix/174-exec-cwd into main 2026-02-28 05:48:49 +00:00
Collaborator

Fixes #174

Problem

ToolsPlugin._base_dir defaulted to Path.cwd(), so the exec tool ran commands in whatever directory the process started in — not the agent's workspace.

Fix

  • configure() accepts _workspace_path from config (for testing)
  • start() resolves workspace path from registry via workspace.get_path() (same pattern as soul plugin)
  • _exec() passes cwd=self._base_dir to subprocess.run()

Tests

  • test_configure_workspace_path — verifies config sets base_dir
  • test_exec_runs_in_workspace_dir — verifies exec runs in workspace dir
  • All 25 tests pass, ruff check + format clean
Fixes #174 ## Problem `ToolsPlugin._base_dir` defaulted to `Path.cwd()`, so the exec tool ran commands in whatever directory the process started in — not the agent's workspace. ## Fix - `configure()` accepts `_workspace_path` from config (for testing) - `start()` resolves workspace path from registry via `workspace.get_path()` (same pattern as soul plugin) - `_exec()` passes `cwd=self._base_dir` to `subprocess.run()` ## Tests - `test_configure_workspace_path` — verifies config sets base_dir - `test_exec_runs_in_workspace_dir` — verifies exec runs in workspace dir - All 25 tests pass, ruff check + format clean
fix: tools plugin uses workspace path instead of cwd (#174)
All checks were successful
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Successful in 20s
CI / test (3.12) (pull_request) Successful in 22s
CI / test (3.13) (pull_request) Successful in 22s
E2E Tests / e2e (pull_request) Successful in 14s
CI / build (pull_request) Successful in 7s
5f0f479f92
Zeus approved these changes 2026-02-28 05:47:07 +00:00
Zeus left a comment
Collaborator

LGTM. Clean fix — tools plugin gets workspace path from registry and passes it as cwd to subprocess. Tests cover both config injection and actual pwd verification.

LGTM. Clean fix — tools plugin gets workspace path from registry and passes it as cwd to subprocess. Tests cover both config injection and actual pwd verification.
k9ert force-pushed fix/174-exec-cwd from 5f0f479f92
All checks were successful
CI / lint (pull_request) Successful in 9s
CI / test (3.11) (pull_request) Successful in 20s
CI / test (3.12) (pull_request) Successful in 22s
CI / test (3.13) (pull_request) Successful in 22s
E2E Tests / e2e (pull_request) Successful in 14s
CI / build (pull_request) Successful in 7s
to 89c55cc449
All checks were successful
CI / lint (pull_request) Successful in 8s
CI / test (3.11) (pull_request) Successful in 19s
CI / test (3.12) (pull_request) Successful in 21s
CI / test (3.13) (pull_request) Successful in 21s
E2E Tests / e2e (pull_request) Successful in 14s
CI / build (pull_request) Successful in 7s
2026-02-28 05:47:50 +00:00
Compare
k9ert merged commit 02c4f5719b into main 2026-02-28 05:48:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot!175
No description provided.