redhat-et / redhat-et/docsclaw

CLI --workspace flag should override agent-config.yaml workspace

Open Beginner friendly
#106 0 comments 0 reactions 0 assignees View on GitHub

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

  • workspace in agent-config.yaml is part of the agent's packaged definition (ships with the image/K8s manifests).
  • --workspace is 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 --workspace flag overrides agent-config.yaml workspace.
  • Config value still used when flag is empty.
  • Default /workspace used 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.