Skip to content

fix: propagate app settings to subprocess agents - #430

Open
zhengxuyu wants to merge 3 commits into
mainfrom
fix/406-api-key-env
Open

fix: propagate app settings to subprocess agents#430
zhengxuyu wants to merge 3 commits into
mainfrom
fix/406-api-key-env

Conversation

@zhengxuyu

Copy link
Copy Markdown
Collaborator

Summary

  • pass the current non-empty application settings into company-hosted subprocess environments
  • make SubprocessExecutor and the ACP script backend share the same settings-to-environment mapping
  • include both stdout and stderr when reporting non-zero script exits
  • add regression coverage for API-key propagation and the real run.py stdout failure message
  • bump package version to 0.7.111

Root cause

Settings loaded values from .onemancompany/.env in the parent process, but script children only inherited the shell environment. Under process managers this could leave run.py without OPENROUTER_API_KEY or another provider key. At the same time, SubprocessExecutor only inspected stderr, while standalone_runner.py reports missing credentials through stdout, reducing the useful failure to Unknown error.

Verification

  • regression tests fail before the fix for missing settings propagation and stdout-only failures
  • configured API keys and base URLs are passed to child processes; empty settings are not exported
  • ACP script execution follows the same environment contract
  • focused executor/config/ACP tests: 68 passed, 1 skipped
  • full suite: 4556 passed, 5 skipped
  • pre-commit unit suite: 4530 passed, 2 skipped
  • diff checks passed

Quality checklist

# Check Answer
1 What changed Shared settings environment propagation and combined subprocess error reporting
2 Root cause fix Yes; children receive the same configured values the app loaded, and stdout failures remain visible
3 Single source of truth Yes; core.config.get_settings_environment() is reused by both script backends
4 Test regression Full suite passed with 4556 passed and 5 skipped
5 Reuse Yes; extends the existing subprocess environment and error handling paths

Fixes #406

@zhengxuyu

Copy link
Copy Markdown
Collaborator Author

Review follow-up: fixed format_process_error to enforce the 500-character limit including the newline separator. Updated package version is now 0.7.113. Pre-commit unit suite: 4531 passed, 2 skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standalone run.py agents (SubprocessExecutor) can't see company API keys — .env not exported to process environment

1 participant