Skip to content

feat: Phase 7 — Worker Boundary and Cloud-Safe Execution Profiles#2

Merged
OgeonX-Ai merged 3 commits into
mainfrom
docs/portfolio-hardening-20260610
Jun 15, 2026
Merged

feat: Phase 7 — Worker Boundary and Cloud-Safe Execution Profiles#2
OgeonX-Ai merged 3 commits into
mainfrom
docs/portfolio-hardening-20260610

Conversation

@OgeonX-Ai

Copy link
Copy Markdown
Contributor

Summary

  • WorkerBoundary (maf_starter/worker_boundary.py): async dispatch via asyncio.create_task, immediate run_id return, status tracking. Satisfies WRKR-01 — HTTP ingress never waits for long-running execution.
  • ExecutionProfile (maf_starter/execution_profile.py): LOCAL and CLOUD_SAFE profiles. CLOUD_SAFE rejects subprocess providers (gemini-cli, claude-cli, codex-cli) via assert_provider_allowed(). Satisfies WRKR-02, WRKR-03.
  • CLI --profile flag (autogen_starter/cli.py): choices local (default) or cloud-safe. Notice printed when cloud-safe is active.
  • Provider fallback guard (maf_starter/provider_fallback.py): profile enforcement injected before any subprocess spawn.
  • 27 new tests across test_worker_boundary.py, test_execution_profile.py, test_phase7_e2e.py.

Test plan

  • python -m pytest tests/ -v — all tests pass
  • python main.py devui --profile cloud-safe — prints cloud-safe notice on startup
  • Subprocess provider rejected with informative error under --profile cloud-safe
  • Local profile accepts all providers unchanged

Generated with Claude Code

Aitomates and others added 3 commits June 14, 2026 14:44
- WorkerBoundary: async dispatch via asyncio.create_task, status tracking
- ExecutionProfile: LOCAL/CLOUD_SAFE enum, assert_provider_allowed guard
- 27 new tests covering WRKR-01, WRKR-02, WRKR-03

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes WRKR-01, WRKR-02, WRKR-03

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d45101ac8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread autogen_starter/cli.py
args = parser.parse_args()

# Resolve execution profile from --profile flag (default: local).
profile = CLOUD_SAFE_PROFILE if args.profile == WorkerProfile.CLOUD_SAFE.value else LOCAL_PROFILE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Enforce the selected cloud-safe profile

When --profile cloud-safe is used with AUTOGEN_PROVIDER=gemini-cli, claude-cli, or codex-cli, the selected profile is only assigned and printed; run_blocking_chat and run_resumable_step still call create_model_client(settings) without checking or passing it, and dashboard starts the app without preserving it. Consequently, a command advertised as disabling subprocess providers still constructs and runs them.

Useful? React with 👍 / 👎.

Comment on lines +321 to +324
profile: ExecutionProfile = LOCAL_PROFILE,
):
# Guard: reject subprocess-backed providers when the profile disallows them.
profile.assert_provider_allowed(step.provider)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the execution profile through fallback calls

The new guard always receives LOCAL_PROFILE in production because both internal _execute_chain_step call sites omit the profile argument and no runtime path passes CLOUD_SAFE_PROFILE. Therefore, when a cloud-safe MAF run reaches a CLI fallback, the guard permits it and the subprocess is still spawned; the active profile needs to be carried through the middleware and forwarded here.

Useful? React with 👍 / 👎.

Comment on lines +50 to +51
task = asyncio.create_task(self._run(run_id, workflow))
self._tasks[run_id] = task

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Release completed tasks from the worker registry

Every submission stores its task in _tasks, but completed tasks are never removed and there is no cleanup method. In a long-lived HTTP worker, each run permanently grows this registry and retains a completed Task; add completion cleanup while retaining the separately tracked status.

Useful? React with 👍 / 👎.

@OgeonX-Ai OgeonX-Ai enabled auto-merge (squash) June 14, 2026 18:58
@OgeonX-Ai OgeonX-Ai merged commit f537373 into main Jun 15, 2026
2 checks passed
@OgeonX-Ai OgeonX-Ai deleted the docs/portfolio-hardening-20260610 branch June 15, 2026 10:16
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