Skip to content

v29: Per-user config, agent manager enhancements, MCP improvements#30

Merged
wenaus merged 1 commit into
mainfrom
infra/baseline-v29
Jan 25, 2026
Merged

v29: Per-user config, agent manager enhancements, MCP improvements#30
wenaus merged 1 commit into
mainfrom
infra/baseline-v29

Conversation

@wenaus

@wenaus wenaus commented Jan 25, 2026

Copy link
Copy Markdown
Member

Summary

Infrastructure baseline v29 brings per-user configuration support, agent manager improvements, and MCP enhancements.

Key Changes

  • Per-user configuration override (SWF_TESTBED_CONFIG env var) - multiple users can run separate testbed instances with different configurations
  • Agent manager enhancements - config-driven namespace/agent selection, REST logging, restart command, immediate heartbeat, clean disconnect
  • New MCP tool: get_testbed_status - comprehensive status combining agent manager, namespace, and workflow agents
  • MCP improvements - log filtering fixes, heartbeat API fix, monitor_urls in responses
  • Documentation - new agent-management.md, fast-processing-workflow.md, 5 SVG architectural diagrams
  • Signal handlers (swf-common-lib) - cleaner shutdown on SIGTERM/SIGINT

See RELEASE_NOTES.md for full details.

🤖 Generated with Claude Code

- BaseAgent resolves config: env var > arg > default workflows/testbed.toml
- Store resolved config_path as self.config_path for subclasses
- Add SIGTERM/SIGQUIT handlers for graceful EXITED reporting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 25, 2026 13:33
@github-actions

Copy link
Copy Markdown

Test Coverage Summary

-------------------------------------------------------------------
src/swf_common_lib/__init__.py            0      0   100%
src/swf_common_lib/api_utils.py          53     53     0%   8-124
src/swf_common_lib/base_agent.py        387    387     0%   5-774
src/swf_common_lib/config_utils.py       30     30     0%   7-102
src/swf_common_lib/logging_utils.py      33      0   100%
src/swf_common_lib/rest_logging.py       80     80     0%   8-157
-------------------------------------------------------------------
TOTAL                                   583    550     6%
============================== 5 passed in 0.22s ===============================

@wenaus wenaus merged commit a5238a1 into main Jan 25, 2026
7 checks passed
@wenaus wenaus deleted the infra/baseline-v29 branch January 25, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds infrastructure baseline updates to the common agent runtime to support per-user testbed configuration selection and more graceful shutdown behavior.

Changes:

  • Resolve testbed config path via config_path arg, SWF_TESTBED_CONFIG, or default workflows/testbed.toml
  • Always load the testbed configuration to set the namespace during agent initialization
  • Register process signal handlers in run() to trigger graceful shutdown

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +280 to +282
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGQUIT, signal_handler)

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions cleaner shutdown on SIGTERM/SIGINT, but this code registers SIGTERM and SIGQUIT. If SIGINT handling is intended (to unify Ctrl+C and SIGTERM behavior/logging), register SIGINT here; otherwise consider updating the PR description/release notes to match the actual signals handled.

Copilot uses AI. Check for mistakes.
raise KeyboardInterrupt(f"Received {sig_name}")

signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGQUIT, signal_handler)

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signal.SIGQUIT is not available on all platforms (notably Windows). Calling signal.signal(signal.SIGQUIT, ...) will raise at runtime where SIGQUIT is undefined, preventing the agent from starting. Consider guarding this registration (e.g., only register SIGQUIT when present) or limiting to signals that exist across supported platforms.

Suggested change
signal.signal(signal.SIGQUIT, signal_handler)
if hasattr(signal, "SIGQUIT"):
signal.signal(signal.SIGQUIT, signal_handler)

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +155
if config_path is None:
env_config = os.getenv('SWF_TESTBED_CONFIG')
if env_config:
# Env var is filename, resolve to workflows/ directory
if not env_config.startswith('workflows/') and '/' not in env_config:

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config_path used to be effectively optional (when None), but this change now always resolves a default file path and will attempt to load a config even when callers omit config_path. If any existing consumers relied on config_path=None meaning “don’t load config / no namespace”, this becomes a breaking behavior change. Consider preserving the old behavior (only resolve default when explicitly requested), or clearly document the new defaulting behavior (incl. SWF_TESTBED_CONFIG) and treat it as a deliberate breaking change/version bump.

Copilot uses AI. Check for mistakes.
Comment on lines +165 to +167
try:
config = load_testbed_config(config_path=config_path)
self.namespace = config.namespace

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load_testbed_config(config_path=...) is now called unconditionally. If a caller passes an empty string (previously treated as falsy and skipped), Path('') resolves to the current directory and the load will fail with a non-TestbedConfigError (e.g., IsADirectoryError) that won’t be caught/logged by this except. Consider validating config_path (non-empty, points to a file) before calling load_testbed_config, or treating empty string the same as None.

Copilot uses AI. Check for mistakes.
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.

2 participants