Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
gateway install --force regenerates the systemd service file and drops user-added Environment entries (e.g. AWS_PROFILE=default), breaking AWS SDK credential discovery on EC2 instances using IAM instance roles for Bedrock access.
Steps to reproduce
- Deploy OpenClaw on EC2/ECS/Agent Core/Lambda with IAM instance/services role granting Bedrock access
- Configure amazon-bedrock provider with
"auth": "aws-sdk" in openclaw.json
- Manually add
Environment=AWS_PROFILE=default to the systemd service file to make credential chain work
- Run
openclaw gateway install --force (or upgrade triggers reinstall)
- Gateway restarts via systemd
- Main agent works, but pi-coding-agent subagent fails
Expected behavior
gateway install --force should preserve user-added Environment= entries in the systemd service file, or provide a documented override mechanism (e.g. systemd drop-in directory or config-level env block)
pi-coding-agent should inherit the parent gateway's amazon-bedrock provider config including "auth": "aws-sdk", not require a separate API key
- AWS SDK credential chain (Instance Role → IMDS) should work out of the box in systemd environments on EC2
Actual behavior
gateway install --force regenerates the entire systemd service file, dropping any manually added Environment= entries (e.g. AWS_PROFILE=default)
pi-coding-agent fails with: No API key found for amazon-bedrock
- Adding
AWS_PROFILE=default to the service file fixes it, but gets overwritten on next gateway install --force
- Error log:
⚠️ Agent failed before reply: No API key found for amazon-bedrock.
Use /login or set an API key environment variable.
OpenClaw version
2026.4.5 (3e72c03)
Operating system
Ubuntu 24.04 (arm64) on AWS EC2
Install method
npm global
Model
amazon-bedrock/global.anthropic.claude-opus-4-6-v1
Provider / routing chain
openclaw -> amazon-bedrock (Bedrock Converse Stream API)
Additional provider/model setup details
EC2 Instance Role with Bedrock access policy.
Provider config uses "auth": "aws-sdk" in openclaw.json.
No API keys — relies on IMDS credential chain.
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Workaround
Add AWS_PROFILE=default to ~/.openclaw/.env:
This file is not overwritten by gateway install --force and is loaded by the gateway at startup.
Related Issues
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
gateway install --forceregenerates the systemd service file and drops user-added Environment entries (e.g. AWS_PROFILE=default), breaking AWS SDK credential discovery on EC2 instances using IAM instance roles for Bedrock access.Steps to reproduce
"auth": "aws-sdk"in openclaw.jsonEnvironment=AWS_PROFILE=defaultto the systemd service file to make credential chain workopenclaw gateway install --force(or upgrade triggers reinstall)Expected behavior
gateway install --forceshould preserve user-addedEnvironment=entries in the systemd service file, or provide a documented override mechanism (e.g. systemd drop-in directory or config-level env block)pi-coding-agentshould inherit the parent gateway's amazon-bedrock provider config including"auth": "aws-sdk", not require a separate API keyActual behavior
gateway install --forceregenerates the entire systemd service file, dropping any manually addedEnvironment=entries (e.g.AWS_PROFILE=default)pi-coding-agentfails with:No API key found for amazon-bedrockAWS_PROFILE=defaultto the service file fixes it, but gets overwritten on nextgateway install --forceOpenClaw version
2026.4.5 (3e72c03)
Operating system
Ubuntu 24.04 (arm64) on AWS EC2
Install method
npm global
Model
amazon-bedrock/global.anthropic.claude-opus-4-6-v1
Provider / routing chain
openclaw -> amazon-bedrock (Bedrock Converse Stream API)
Additional provider/model setup details
EC2 Instance Role with Bedrock access policy.
Provider config uses "auth": "aws-sdk" in openclaw.json.
No API keys — relies on IMDS credential chain.
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Workaround
Add
AWS_PROFILE=defaultto~/.openclaw/.env:This file is not overwritten by
gateway install --forceand is loaded by the gateway at startup.Related Issues