Skip to content

Conversation

@svilupp
Copy link
Owner

@svilupp svilupp commented Dec 2, 2025

Implements automatic webhook URL management for Layercode agents:

  • Add LAYERCODE_AGENT_ID config option (env var or --agent-id CLI arg)
  • Add --unsafe-update-webhook CLI flag to enable auto-update during tunnel
  • Fetch current webhook before updating (backup for restore)
  • Update agent webhook to tunnel URL via Layercode API
  • Restore previous webhook on shutdown if unchanged
  • Add helpful tip in banner when tunnel runs without auto-update
  • Full validation: requires --tunnel + agent ID to use auto-update

API endpoints used:

  • GET /v1/agents/{agent_id} - fetch agent details
  • POST /v1/agents/{agent_id} - update webhook URL

Safety features:

  • Only restores webhook if still pointing to our tunnel
  • Gracefully handles API failures
  • Clear logging of all webhook operations

Implements automatic webhook URL management for Layercode agents:

- Add LAYERCODE_AGENT_ID config option (env var or --agent-id CLI arg)
- Add --unsafe-update-webhook CLI flag to enable auto-update during tunnel
- Fetch current webhook before updating (backup for restore)
- Update agent webhook to tunnel URL via Layercode API
- Restore previous webhook on shutdown if unchanged
- Add helpful tip in banner when tunnel runs without auto-update
- Full validation: requires --tunnel + agent ID to use auto-update

API endpoints used:
- GET /v1/agents/{agent_id} - fetch agent details
- POST /v1/agents/{agent_id} - update webhook URL

Safety features:
- Only restores webhook if still pointing to our tunnel
- Gracefully handles API failures
- Clear logging of all webhook operations
@svilupp svilupp closed this Dec 2, 2025
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.

3 participants