Skip to content

fix(deploy): remove credential injection from deploy_local_agent (#251) - #258

Merged
vybe merged 3 commits into
mainfrom
feature/251-fix-deploy-local
Apr 3, 2026
Merged

vybe merged 3 commits into
mainfrom
feature/251-fix-deploy-local

Conversation

@vybe

@vybe vybe commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove the credentials parameter and injection logic from deploy_local_agent — file-based deploy is self-contained (.env and credential files are included in the archive)
  • This eliminates the 2s fixed sleep + 30s HTTP timeout that caused deploys with credentials to hang or silently fail
  • Fix DeployLocalResponse model to remove unused credentials_imported / credentials_injected fields

Root 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 — remove credentials from request, credential fields from response
  • src/backend/services/agent_service/deploy.py — remove credential validation, tracking, and injection (~60 lines removed)
  • src/mcp-server/src/tools/agents.ts — remove credentials parameter, update description

Net: -118 lines

Test Plan

  • Python syntax verified
  • TypeScript compiles clean
  • Tested deploy without credentials on remote Trinity — works
  • No other code references the removed credentials parameter on DeployLocalRequest

Closes #251

vybe and others added 3 commits April 3, 2026 17:52
…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]>
@vybe vybe changed the title fix(deploy): replace fixed 2s sleep with health-check polling for credential injection (#251) fix(deploy): remove credential injection from deploy_local_agent (#251) Apr 3, 2026
@vybe
vybe merged commit acf2d10 into main Apr 3, 2026
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.

fix: Deploy from file broken — default to deploy from GitHub repository

1 participant