redhat-et / redhat-et/docsclaw
CLI --workspace flag should override agent-config.yaml workspace
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2
- Forks
- 1
- Avg merge
- 6h 9m
- Merged PRs (30d)
- 1
Description
Problem
Workspace resolution in internal/cmd/serve.go (resolveWorkspace) uses the precedence:
agent-config.yaml > --workspace flag > default
This is backwards from the standard convention (CLI flag > env > config > default). When a user passes --workspace /tmp/test-workspace but the packaged agent-config.yaml hardcodes workspace: /tmp/standalone-agent, the flag is silently ignored and file tools are confined to the wrong directory.
Discovered while manually testing PR #102 (see scratch/phase2-manual-testing.md).
Context
workspaceinagent-config.yamlis part of the agent's packaged definition (ships with the image/K8s manifests).--workspaceis an operational override and should win when explicitly set.- Pre-existing issue from #98 (
make workspace path configurable via CLI flag), not introduced by #102.
Proposed fix
Flip precedence in resolveWorkspace:
func resolveWorkspace(cfgWorkspace, flagWorkspace string) string {
if v := strings.TrimSpace(flagWorkspace); v != "" {
return v
}
if v := strings.TrimSpace(cfgWorkspace); v != "" {
return v
}
return defaultWorkspace
}
Acceptance criteria
- Explicit
--workspaceflag overridesagent-config.yamlworkspace. - Config value still used when flag is empty.
- Default
/workspaceused when neither is set. - Update docs/tests accordingly (incl. the note in
scratch/phase2-manual-testing.md).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in internal/cmd/serve.go at resolveWorkspace and review the workspace resolution paths and related tests. Check the note in scratch/phase2-manual-testing.md, then update the documentation and tests so explicit --workspace, config workspace, and the /workspace default are each verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100