diff options
| author | Adam Malczewski <[email protected]> | 2026-05-23 05:25:03 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-05-23 05:25:03 +0900 |
| commit | 225d3ea65cfc35d211fc66e30cf05cbc693d37e4 (patch) | |
| tree | 1d765743942eb8c5d519fea37763ed6a36b90eec /packages/frontend/src/lib/components | |
| parent | 9287cccb29d135ea19f2612c26f3090c94820d8c (diff) | |
| download | dispatch-225d3ea65cfc35d211fc66e30cf05cbc693d37e4.tar.gz dispatch-225d3ea65cfc35d211fc66e30cf05cbc693d37e4.zip | |
feat: relative working directory support and subagent tab cwd propagation
- Resolve relative cwd paths (e.g. ./subtask) against parent's working directory at runtime
- check-dir endpoint resolves relative paths and returns the resolved absolute path
- AgentBuilder shows resolved path below input for relative paths, updated helper text
- tab-created event now includes workingDirectory so subagent tabs display their cwd in sidebar
- Add workingDirectory to tab-created AgentEvent type definition
- spawnChildAgent stores resolved absolute path instead of raw relative path
Diffstat (limited to 'packages/frontend/src/lib/components')
| -rw-r--r-- | packages/frontend/src/lib/components/AgentBuilder.svelte | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/frontend/src/lib/components/AgentBuilder.svelte b/packages/frontend/src/lib/components/AgentBuilder.svelte index 65fd764..d85a6a3 100644 --- a/packages/frontend/src/lib/components/AgentBuilder.svelte +++ b/packages/frontend/src/lib/components/AgentBuilder.svelte @@ -62,6 +62,7 @@ const modelCache = new Map(); let formScope = $state("global"); let formCwd = $state(""); let cwdExists = $state<boolean | null>(null); + let cwdResolved = $state<string | null>(null); let cwdCheckTimer: ReturnType<typeof setTimeout> | null = null; let formSkills = $state<Set<string>>(new Set()); let formTools = $state<Set<string>>(new Set()); @@ -301,6 +302,7 @@ const modelCache = new Map(); const cwd = formCwd; if (!cwd.trim()) { cwdExists = null; + cwdResolved = null; return; } if (cwdCheckTimer) clearTimeout(cwdCheckTimer); @@ -312,9 +314,11 @@ const modelCache = new Map(); if (res.ok) { const data = await res.json(); cwdExists = data.exists ?? false; + cwdResolved = data.resolved ?? null; } } catch { cwdExists = null; + cwdResolved = null; } }, 300); }); @@ -479,8 +483,12 @@ const modelCache = new Map(); </div> {#if cwdExists === false && formCwd.trim()} <span class="text-xs text-warning">Directory will be created automatically on first message.</span> - {:else} - <span class="text-xs text-base-content/50">Absolute path. Leave empty to use the project root.</span> + {/if} + {#if cwdResolved && formCwd.trim() && cwdResolved !== formCwd.trim()} + <span class="text-xs text-base-content/50 font-mono">{cwdResolved}</span> + {/if} + {#if !formCwd.trim()} + <span class="text-xs text-base-content/50">Absolute or relative path. Relative paths resolve against the parent agent's working directory, or the project root.</span> {/if} </div> |
