Skip to content

Unify workspace path handling in tools#9

Closed
meanaverage wants to merge 2 commits intogobbleyourdong:mainfrom
meanaverage:workspace-path-tool-fixes
Closed

Unify workspace path handling in tools#9
meanaverage wants to merge 2 commits intogobbleyourdong:mainfrom
meanaverage:workspace-path-tool-fixes

Conversation

@meanaverage
Copy link
Copy Markdown

This PR unifies workspace path handling across the main tool surface so the agent behaves more consistently between host and Docker-style environments.

What was fixed:

  • introduced a shared workspace-path normalizer in tsunami/tools/filesystem.py
  • normalized common path variants seen in traces, including /app/workspace/..., /workspace/tsunami/workspace/..., /workspace/deliverables/..., and repo-root deliverables/...
  • updated match_glob and match_grep to resolve directories through the shared resolver instead of raw Path(...).resolve()
  • updated shell_exec so bad workspace roots inside command strings are normalized before execution and workdir is resolved through the same shared resolver
  • updated python_exec so ARK_DIR, WORKSPACE, and DELIVERABLES are derived from the configured workspace_dir instead of hardcoded ark_dir/workspace
  • updated swell_analyze to remove ad hoc Docker-specific fallback rewriting and use the shared resolver for both input directories and output paths
  • updated generate_image so save_path uses the same resolver instead of its own partial workspace/app/workspace stripping logic
  • updated project_init guidance so the model is told to use shell_exec with workdir='deliverables/' rather than absolute-path cd commands

Why this matters:

  • before this change, different tools were interpreting the same project path in different ways
  • that led to runs where one tool correctly found workspace/deliverables/ and the next tool looked in /workspace/tsunami/workspace/..., repo-root deliverables/..., or another non-existent variant
  • the result was repeated false directory-not-found failures even when the project actually existed

Validation:

  • python3 -m py_compile passed for all modified tool modules

Important caveat:

  • this PR intentionally does not modify tsunami/tools/swell.py or tsunami/tools/swell_build.py
  • those tools currently use workspace_dir.parent / project-root-style working directories, and that may be intentional to preserve broader repo visibility for eddy workers
  • I left them unchanged and would like explicit review on whether they should remain repo-root scoped or also move to stricter workspace-relative semantics later

@meanaverage meanaverage closed this Apr 3, 2026
@meanaverage
Copy link
Copy Markdown
Author

Resubmitted as PR #10 for no merge conflicts

@meanaverage meanaverage deleted the workspace-path-tool-fixes branch April 3, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant