Repository navigation
fix(deploy): remove credential injection from deploy_local_agent (#251) - #258
Merged
Merged
Conversation
…dential injection (#251) The deploy_local_agent credential injection used a fixed 2-second sleep before attempting to inject credentials into the newly created agent container. Agent startup takes 5-30+ seconds depending on template, GitHub clone, and container init overhead, causing credential injection to silently fail or hang. Replace with health-check polling (every 2s, up to 60s) using the existing AgentClient.health_check() method, add retry logic (3 attempts with backoff) for the injection itself, and fix credentials_injected count to accurately reflect actual injection status. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
File-based deploy should be self-contained — the archive includes .env and all credential files. Remove the separate credential injection parameter and logic that caused hangs (2s fixed sleep before HTTP call to agent server that wasn't ready yet). Changes: - Remove `credentials` parameter from DeployLocalRequest model - Remove `credentials_imported`/`credentials_injected` from response - Remove entire credential injection block from deploy.py (was ~60 lines) - Remove `credentials` parameter from MCP deploy_local_agent tool - Update tool description: .env should be included in archive Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sync feature flow doc with code changes — remove all references to the credentials parameter, credential injection step, and related error codes/size limits. Archive is now self-contained. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
credentialsparameter and injection logic fromdeploy_local_agent— file-based deploy is self-contained (.envand credential files are included in the archive)DeployLocalResponsemodel to remove unusedcredentials_imported/credentials_injectedfieldsRoot Cause
The deploy flow had a separate credential injection step that tried to HTTP POST credentials to the agent's internal server after creation. It used a fixed 2-second sleep before the call, but agent startup takes 5-30+ seconds. The agent server was never ready in time, causing silent failures or hangs.
The fix is to remove this path entirely — credentials belong in the archive, not as a separate injection step.
Changes
src/backend/models.py— removecredentialsfrom request, credential fields from responsesrc/backend/services/agent_service/deploy.py— remove credential validation, tracking, and injection (~60 lines removed)src/mcp-server/src/tools/agents.ts— removecredentialsparameter, update descriptionNet: -118 lines
Test Plan
Closes #251