Skip to main content

T4L Agent

t4l-agent runs one T4L connector and one coach loop against an existing OpenClaw agent.

OpenClaw owns the model, provider, reasoning mode, credentials, tools, and native session execution. T4L does not install or reconfigure that runtime.

The whole runtime

T4L Trainer phone
        |
        | signed HTTPS
        v
OpenClaw t4l-connect plugin
        |
        | narrow loopback proxy
        v
t4l-agent run
  ├─ t4l-server + SQLite
  └─ coach loop -> existing OpenClaw agent

There is one production command: t4l-agent run.

Host setup

The host owner does this once.

  1. Install the @t4l-trainer/openclaw-t4l-connect plugin in the existing OpenClaw profile.
  2. Configure its agentId and loopback connectorBaseUrl, normally http://127.0.0.1:8787.
  3. Give both the OpenClaw Gateway and t4l-agent the same random T4L_CONNECTOR_RUNTIME_TOKEN.
  4. Start t4l-agent run.

The plugin contains only:

  • the authenticated pre-model /t4l connect CODE command;
  • a strict allowlist of phone routes;
  • an HTTPS-to-loopback proxy.

It does not install packages, choose releases, manage services, or receive provider credentials.

For local plugin development:

cd openclaw_plugins/t4l-connect
npm test
npm pack --dry-run

Install a published version with OpenClaw's normal pinned-plugin flow. Configure it through the OpenClaw control surface for the selected profile.

Install the Python runtime

Python 3.11 or newer is required. Install t4l-server and t4l-agent into the same environment.

For local development:

python3 -m venv .venv
.venv/bin/pip install -e ../t4l-server
.venv/bin/pip install -e '.[dev]'

Run

export T4L_CONNECTOR_RUNTIME_TOKEN='replace-with-a-long-random-secret'

t4l-agent run \
  --agent-id main \
  --agent-name Atlas \
  --agent-profile coach-01 \
  --connector-owner-id 'slack:workspace-id:user-id' \
  --data-dir /srv/t4l/coach-01 \
  --host 127.0.0.1 \
  --port 8787

The owner identity is exactly channel:account:sender. Repeat --connector-owner-id for multiple authenticated owner channels.

Use the existing OpenClaw profile and agent id. Optional --agent-home-dir, --agent-state-dir, and --agent-config-path flags point at that runtime. T4L never creates a second agent.

The connector binds to loopback by default. The phone enters the public HTTPS OpenClaw Gateway address, not the loopback connector address. Public binding requires --allow-public-bind and still requires trusted HTTPS.

T4L_SERVER_API_KEY may provide a stable host-only MCP key. Otherwise the process creates one. The phone never receives it.

Phone connection

  1. The phone enters the Gateway address.
  2. It creates an Ed25519 key and receives an eight-character pairing code.
  3. It shows /t4l connect XXXX-XXXX.
  4. The user sends that command in an authenticated OpenClaw owner channel.
  5. The plugin forwards only the code and verified owner identity to the loopback connector.
  6. The phone proves key possession and receives a device-bound token scoped to chat, sync, and status.

There is no post-pair installer, release selection, rollback job, second code, API-key form, or model-driven host setup.

Coach behavior

The coach loop uses the existing OpenClaw agent with no provider, model, reasoning, or delivery override. Every turn uses a fresh isolated session key. It does not send a message through OpenClaw channels; the reviewed reply returns through T4L chat.

Purpose-specific instructions are embedded in the Python package:

  • core.md
  • onboarding.md
  • chat.md
  • training-block.md

The loop loads only the files needed for the current turn.

The phone remains authoritative:

  • onboarding produces a pending athlete_setup_draft.v1;
  • planning produces a pending training_block_plan.v1;
  • the phone explicitly reviews and accepts both;
  • the phone chooses the daily workout variant locally;
  • agent chat cannot silently rewrite accepted state.

Exercise videos must be exact YouTube Shorts for the selected exercise. The host verifies the URL and live title before storing a plan.

The coach is training-and-recovery only. Nutrition, hydration, supplement, weight, and body-composition prescriptions are blocked before and after model execution.

Development

.venv/bin/ruff format --check .
.venv/bin/ruff check .
.venv/bin/mypy
.venv/bin/pytest -q

cd openclaw_plugins/t4l-connect
npm test
npm pack --dry-run

The tests use runtime fakes. Before production, also run one live OpenClaw smoke test for:

  • runtime readiness;
  • non-delivering coach execution;
  • owner and non-owner pairing commands;
  • the Gateway HTTPS proxy;
  • a complete phone pairing and training-block review round trip.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

t4l_agent-0.3.1.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

t4l_agent-0.3.1-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file t4l_agent-0.3.1.tar.gz.

File metadata

  • Download URL: t4l_agent-0.3.1.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for t4l_agent-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a855b75c35f48b73a710b5938df76f7cf11e67170b6f063c296b30675a94a0c2
MD5 9040dcb6703399f1ebcaf3d90042eb6b
BLAKE2b-256 d53ed07377f28dd6daa8b0f83db3c5ea6f485f71ed200ebd2c6069c08e6719c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for t4l_agent-0.3.1.tar.gz:

Publisher: publish.yml on BigSlikTobi/t4l-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file t4l_agent-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: t4l_agent-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for t4l_agent-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6b53c9df270cb52a6367a799d59937db8261e8e0fcd12a2cb57f66c5843314
MD5 c17a77eba65cd6fd160baabafdd9cf9d
BLAKE2b-256 8432938595456d1fbdecf541a8be05bddfe36c0f6f56bc58c4efacc23205317f

See more details on using hashes here.

Provenance

The following attestation bundles were made for t4l_agent-0.3.1-py3-none-any.whl:

Publisher: publish.yml on BigSlikTobi/t4l-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.2

2 files

This release

0.3.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page