Conversation
7 tasks
AbirAbbas
added a commit
that referenced
this pull request
May 7, 2026
* chore(deps): add hax-sdk + python-dotenv Both unlock the HITL plan-approval gate landing in a follow-up commit: hax-sdk is the human-approval client SWE-AF posts plans to, python-dotenv lets containerised builds pick up HAX_API_KEY (and any future env-driven config) from a mounted .env without baking it into the image. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(config): add plan-approval knobs to BuildConfig max_plan_revision_iterations bounds the human "request changes" loop so a reviewer can't accidentally pin a build forever; default 2 mirrors the existing tech-lead review cap. approval_expires_in_hours is the wall-clock ceiling on the hax-sdk request, default 72h so reviews can span a weekend without the request expiring out from under the reviewer. Both fields are inert until the HITL block in app.py reads them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(approval): pause builds for human plan review when HAX_API_KEY is set Insert a checkpoint between Phase 1 (plan + git_init) and Phase 2 (execute): when HAX_API_KEY is set in the environment, post the plan to hax-sdk via plan-review-v2 and call agentfield's app.pause(), which transitions the execution to "waiting" on the control plane and blocks until the reviewer responds via webhook. No callback server in-process — the CP owns the resume path, so the agent stays stateless and survives restarts. On request_changes, re-run Architect → Tech Lead → Sprint Planner with the reviewer's feedback (skipping PM since the PRD/scope is fixed) and re-post for approval, bounded by cfg.max_plan_revision_iterations. On rejected / expired / error, return a failure BuildResult without executing. Approval requests are workspace-broadcast by default; setting AGENTFIELD_APPROVAL_USER_ID assigns to a specific Hub user. State is persisted to .artifacts/approval_state.json so a crashed-and-restarted agent can be reasoned about. Also wire load_dotenv() into both swe-planner and swe-fast entry points so HAX_API_KEY (and other env-driven config) is available before Agent() is constructed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(docker): use env_file in local compose so HITL env propagates Replace the hand-listed ANTHROPIC_API_KEY / CLAUDE_CODE_OAUTH_TOKEN / GH_TOKEN passthroughs with env_file: .env. The HITL gate adds HAX_API_KEY (and optionally HAX_SDK_URL, AGENTFIELD_APPROVAL_USER_ID), and growing the hand-listed array every time a new env var is needed loses to just letting docker-compose load the whole .env. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code