Skip to content

fix: refactor path handling to use relative paths with optional cwd#625

Merged
avoidwork merged 9 commits into
mainfrom
fix/relative-paths
Jul 26, 2026
Merged

fix: refactor path handling to use relative paths with optional cwd#625
avoidwork merged 9 commits into
mainfrom
fix/relative-paths

Conversation

@avoidwork

@avoidwork avoidwork commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Description

Refactored all path-building functions across 28 files to use relative paths with an optional cwd parameter instead of importing loadConfig().cwd at module scope. This enables proper virtual filesystem handling where / is the application root.

Key changes:

  • Replaced module-level loadConfig().cwd with empty string default and optional cwdParam parameter across memory, session, scheduler, skills, and tools modules
  • Added cwd option to setupAutoSchedule(), createSkillImpl(), and runScript() for explicit cwd injection
  • Updated 12 prompt files with the 'Use paths as given' rule for virtual filesystem handling
  • Added virtual filesystem documentation to OVERVIEW.md (new Backends section, updated system diagram), FLOWS.md (new Backend Routing Flow), and TUTORIAL.md (new Virtual Filesystem section)
  • Fixed OVERVIEW.md intro cross-references and cleaned corrupted content in FLOWS.md
  • Added /exit command to TUI Navigation table
  • Sorted skill catalog by location (system-skills last) then by name

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • Documentation update

Testing

Tests updated to pass explicit cwd parameter where needed (autoSchedule.test.js). No code behavior changes — all existing tests should pass.

Coverage

  • Line coverage maintained (no code behavior changes)

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

- Change module-level cwd assignments from loadConfig().cwd to empty string
- Add optional cwd parameter to all functions that build paths, defaulting to module-level cwd
- This allows tests to override cwd without modifying module state
- Fixes test compatibility while maintaining relative path behavior
- Replace resolve() with join() in discoverSkills to keep paths relative
- This ensures skills use virtual filesystem paths instead of absolute paths
@avoidwork
avoidwork force-pushed the fix/relative-paths branch from 62ba701 to d22e938 Compare July 25, 2026 21:00
@avoidwork avoidwork changed the title fix: use relative paths for scope and skill resolution fix: refactor path handling to use relative paths with optional cwd Jul 25, 2026
@avoidwork
avoidwork merged commit 51b35f2 into main Jul 26, 2026
2 checks passed
@avoidwork
avoidwork deleted the fix/relative-paths branch July 26, 2026 00:18
@avoidwork avoidwork mentioned this pull request Jul 26, 2026
6 tasks
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