Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 3.52 KB

File metadata and controls

32 lines (21 loc) · 3.52 KB

Running Welt as a Resident Process

As a resident process, Welt connects to Slack over Socket Mode: main.py holds the connection open, and Slack pushes events down it. Nothing has to be reachable from the internet, so there is no request URL to configure. The container image ghcr.io/iwamot/welt packages that process for hosting.

The setup below assumes you already have an agent on AgentCore Runtime, or a managed harness, for Welt to invoke.

Setup

  1. Create a Slack app from manifest.ymlthe pre-filled creation screen is the quickest way there. Two tokens come out of it:

    • In Basic Information > App-Level Tokens, generate a token with the connections:write scope (xapp-1-...).
    • In Install App, install the app to your workspace and copy the Bot User OAuth Token (xoxb-...).
  2. Run the image with those tokens and the ARN to invoke:

    docker run -it \
      -e SLACK_APP_TOKEN=xapp-1-... \
      -e SLACK_BOT_TOKEN=xoxb-... \
      -e AGENT_ARN=arn:aws:bedrock-agentcore:... \
      ghcr.io/iwamot/welt:latest

    Welt picks up AWS credentials the standard SDK way. The container cannot see your local profile, so pass them in as environment variables too, or let the hosting environment's IAM role provide them on AWS. Either identity needs bedrock-agentcore:InvokeAgentRuntime, and bedrock-agentcore:InvokeAgentRuntimeForUser because Welt sends the verified Slack user as the runtimeUserId.

Notes

  • Configuration lists the optional environment variables.
  • Running from source works the same way: uv run --env-file .env main.py, as in the Quick Start, with AGENT_ARN added to the .env file.
  • Running more than one replica is fine, during a rolling update or all the time. Slack's Socket Mode guide allows up to 10 open connections per app and says that "each payload may be sent to any of the connections", so no replica can count on receiving a given event. Welt keeps nothing per thread in the process: interrupt state lives in the Slack message, history is read back from the thread, and the session lives on AgentCore. Slack does not promise that a payload never reaches two connections, so if a repeated turn would matter, make the agent's side effects idempotent.