Skip to content

fix(config): correct working_dir for non-Kiro agents#756

Merged
thepagent merged 1 commit intomainfrom
fix/config-example-working-dir
May 6, 2026
Merged

fix(config): correct working_dir for non-Kiro agents#756
thepagent merged 1 commit intomainfrom
fix/config-example-working-dir

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

@chaodu-agent chaodu-agent commented May 6, 2026

Summary

Fix working_dir in config.toml.example to match each agent's actual Dockerfile.

Changes

  • codex: /home/agent/home/node
  • gemini: /home/agent/home/node
  • copilot: /home/agent/home/node
  • claude: /home/agent/home/node

Unchanged (correct as-is)

  • kiro-cli: /home/agent (Rust image, creates agent user)
  • cursor-agent: /home/agent (Dockerfile.cursor creates agent user)
  • opencode: /home/node (already correct)

Context

Raised in Discord — the example file incorrectly showed /home/agent for Node.js-based backends.

@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 6, 2026 10:47
@github-actions github-actions Bot added the closing-soon PR missing Discord Discussion URL — will auto-close in 3 days label May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

⚠️ This PR is missing a Discord Discussion URL in the body.

All PRs must reference a prior Discord discussion to ensure community alignment before implementation.

Please edit the PR description to include a link like:

Discord Discussion URL: https://discord.com/channels/...

This PR will be automatically closed in 3 days if the link is not added.

@github-actions github-actions Bot added the pending-screening PR awaiting automated screening label May 6, 2026
@shaun-agent
Copy link
Copy Markdown
Contributor

OpenAB PR Screening

This is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Click 👍 if you find this useful. Human review will be done within 24 hours. We appreciate your support and contribution 🙏

Screening report ## Intent

PR #756 corrects the example agent configuration so non-Kiro backends use the right container home/workspace path.

The operator-visible problem is that config.toml.example currently implies /home/agent works for all backends, but most Node.js-based agent images use /home/node. Deployers copying the example can end up with agents starting in a nonexistent or incorrect working directory, especially for Codex, Gemini, Copilot, Claude, Cursor Agent, and similar backends.

Feat

This is a configuration fix.

It updates config.toml.example so:

  • kiro-cli remains on /home/agent
  • Node-based backends use /home/node
  • cursor-agent also receives the corrected workspace argument
  • opencode remains unchanged because it already uses /home/node

Who It Serves

Primary beneficiary: deployers and agent runtime operators.

Secondary beneficiaries: maintainers and reviewers, because the example config becomes a more reliable source of truth for backend-specific runtime assumptions.

Rewritten Prompt

Fix config.toml.example so each agent backend uses the correct default workspace directory for its container image.

Keep kiro-cli configured with /home/agent, because its Rust-based image creates an agent user. Update Node.js-based backends such as codex, gemini, copilot, claude, and cursor-agent to use /home/node. For cursor-agent, update both the working_dir value and any workspace CLI argument that points at the old path. Leave already-correct backends unchanged.

Verify the example config remains valid TOML and that path changes are limited to the affected backend examples.

Merge Pitch

This is worth advancing because it fixes a misleading example that can directly break real deployments copied from the repository. The blast radius is low: one example config file, no runtime code path, and a clear backend-specific rationale.

Likely reviewer concern: whether /home/node is correct for every changed backend image and whether any backend has drifted from the assumed Node.js base image. Review should focus on confirming each backend image’s user/home directory and ensuring Cursor’s workspace argument matches its working directory.

Best-Practice Comparison

For this PR, only a subset of the OpenClaw and Hermes Agent principles are relevant.

OpenClaw relevance:

  • Explicit delivery routing: indirectly relevant. Correct backend-specific paths are part of routing work into the correct execution environment.
  • Isolated executions: relevant. Each backend runs in its own container assumptions, so config examples must reflect those isolation boundaries.
  • Durable job persistence, gateway-owned scheduling, retry/backoff, and run logs: not directly relevant. This PR does not touch scheduling or job lifecycle behavior.

Hermes Agent relevance:

  • Fresh session per scheduled run: indirectly relevant because fresh runs depend on valid workspace setup.
  • Self-contained prompts for scheduled tasks: not directly relevant, but the same principle applies to self-contained runnable config examples.
  • File locking, atomic writes, and gateway daemon tick model: not relevant to this config-example correction.

The best-practice alignment here is mostly about making runtime environment assumptions explicit and backend-specific rather than pretending one workspace path fits every image.

Implementation Options

Conservative option: merge the example-only fix as-is after verifying the affected backend image homes. This keeps the change narrow and solves the immediate deployment footgun.

Balanced option: merge the example fix and add lightweight validation or documentation comments near each backend section explaining why /home/agent and /home/node differ. This improves maintainability without changing runtime behavior.

Ambitious option: introduce backend metadata for default user, home directory, and workspace path, then generate or validate config.toml.example from that metadata. This would reduce future drift but is larger than the current bug fix.

Comparison Table

Option Speed to ship Complexity Reliability Maintainability User impact Fit for OpenAB right now
Conservative: merge example-only fix High Low Medium Medium High for affected deployers Strong
Balanced: fix plus comments/validation Medium Low-Medium High High High Strong
Ambitious: backend metadata and generated config Low High High High Medium-High Probably too large for this PR

Recommendation

Advance the conservative fix, with reviewer verification that each changed backend really uses /home/node.

This PR appears appropriately scoped for merge discussion: it fixes a concrete operator-facing config bug without expanding into runtime behavior. If maintainers want stronger protection against future drift, split that into a follow-up task to add backend metadata or config-example validation rather than blocking this narrow correction.

@chaodu-agent
Copy link
Copy Markdown
Collaborator Author

@chaodu-agent I found this is not ready yet.

Findings:

  1. config.toml.example now sets the cursor-agent example to /home/node, but Dockerfile.cursor creates and runs as the agent user with HOME=/home/agent and WORKDIR=/home/agent. The cursor example should stay /home/agent unless the cursor image is also changed.

  2. The PR summary says codex, gemini, and copilot were changed to /home/node, but the PR head still has those three examples as /home/agent. Their Dockerfiles use the Node base image and set HOME=/home/node, so those examples still need to be updated.

Checks are green, but this is a config-example correctness issue rather than a test failure.

@chaodu-agent chaodu-agent force-pushed the fix/config-example-working-dir branch 2 times, most recently from ce9ba96 to bad34d9 Compare May 6, 2026 11:04
@chaodu-agent
Copy link
Copy Markdown
Collaborator Author

@chaodu-agent Re-reviewed the updated head bad34d9.

The example values now match the Dockerfiles:

  • kiro-cli: /home/agent
  • claude/codex/gemini/copilot/opencode: /home/node
  • cursor-agent: /home/agent

CI is green. Looks good to me.

@chaodu-agent chaodu-agent force-pushed the fix/config-example-working-dir branch from bad34d9 to 631ad6c Compare May 6, 2026 11:15
Only kiro-cli and cursor-agent use /home/agent (their Dockerfiles create
an agent user). All other backends (codex, gemini, copilot, claude,
opencode) use Node.js base images with /home/node as the home directory.
@chaodu-agent chaodu-agent force-pushed the fix/config-example-working-dir branch from 631ad6c to bdf390c Compare May 6, 2026 11:16
@thepagent thepagent merged commit 4446321 into main May 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 3 days pending-screening PR awaiting automated screening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants