Skip to content

Hosted teaching-agent pilot

The pilot selected in ADR-0070 runs full DeepSeek Harness in one Kubernetes pod per root Agent Session. Native child agents share that pod. Emergent authenticates the session owner, provisions the pod, and supplies a person-bound Operations token. The pod has no Kubernetes API credential. Session state and checkpoints use the configured S3-compatible bucket directly, independently of the pod’s lifetime.

The tools base and application data follow the existing image-volume deployment convention. The base supplies Bun, Node, uv/Python, Poppler and ImageMagick. The application image supplies the bundled service and the matching DSH dependency closure, including the separate Node runner. DSH’s SDK uses its host executable for the runtime subprocess, so the SDK runs through Node; the HTTP service remains Bun.

Build the tool base with the installed daemonless Buildah tool:

Terminal window
bash infra/build/build-agent-tools-image.sh reg.example/emergent/agent-tools:2026-10-26
buildah push reg.example/emergent/agent-tools:2026-10-26

The builder reads the Bun version from the workspace packageManager pin, resolves Node and uv from their upstream releases, verifies downloaded checksums, and installs the current system packages from the base’s apt repositories. It retains the resolved versions and package inventory under /usr/local/share/emergent-agent-tools/. Record the resulting image digest for deployment. The optional AGENT_BASE_IMAGE selects a different compatible Debian base; the default is docker.io/library/debian:trixie-slim.

The Argo code-build-oci workflow builds @emergent/agent-runtime and publishes agent-runtime-data alongside the other application data images. Its staging helper copies the installed SDK and runtime’s reachable Bun package-store entries, preserving dependency symlinks and shared hoisted aliases needed by native loaders. It does not resolve a second set of dependencies. The snapshot contains platform-specific native packages: build it for the tools image’s OS, CPU and libc. The entrypoint is bun /app/server.js, with the data image mounted read-only at /app and an emptyDir workspace at /workspace.

The feature is disabled by default. Create the following Secrets through the environment’s existing secret-management process; do not commit plaintext values:

  • emergent-agent-provider: DEEPSEEK_API_KEY.
  • emergent-agent-controller: AGENT_CONTROL_SECRET, AGENT_S3_ACCESS_KEY_ID, and AGENT_S3_SECRET_ACCESS_KEY. The controller secret is loaded into the API service. Worker pods reference only the S3 entries; the control secret stays with the controller.

Use an existing suitable S3 bucket or provision one before enabling the feature. The application stores objects under agent-sessions/<person-id>/<session-id>/. The controller lists only the verified person’s prefix. No new database migration or canonical gradebook storage is needed for the pilot.

Example values for the Emergent chart:

agentSessions:
enabled: true
allowedPersonIds:
- <anton-person-id>
runtimeImage: reg.example/emergent/agent-tools@sha256:<digest>
runtimeDataImage: reg.example/emergent/agent-runtime-data@sha256:<digest>
imagePullSecret: regrobot
operationsUrl: http://emergent-api/mcp
storage:
endpoint: http://common-storage.infra.svc:3900
bucket: app-storage-emergent
region: garage

Set allowedPersonIds to Anton’s Person ID for the personal pilot. The browser preference only exposes the UI; the server uses this configured pilot audience as well as verified session ownership. Replace the images, endpoint and bucket with the environment’s values. The RoleBinding uses the API’s ServiceAccount, derived from services.api.serviceAccount. The role grants get/create/delete for pods and Secrets only in the release namespace. It creates an emergent-agent-runtime account with token automount disabled for session pods.

The chart creates <emergent-release>-agent-sessions, a ConfigMap containing the controller’s nonsecret settings. When agentSessions.enabled is true, the API deployment automatically loads that ConfigMap and the Secret named by agentSessions.storage.secretName (default emergent-agent-controller). It uses a single API replica and the Recreate update strategy. The existing FUNCS_IDLE_TIMEOUT_SEC server option is set to 255 seconds so a failed 90-second pod startup can finish its cleanup before the API connection times out. Other API environment values belong in the services.api.envVars map. Additional environment sources use services.api.envFrom.

Keep one controller process with no rollout overlap for this personal pilot: the API serializes session lifecycle changes in-process. Multiple controllers would need a shared lifecycle lease before enabling horizontal scaling or rolling overlap.

Storage Secret names and key names, provider Secret/key, model, image pull Secret, startup timeout and runtime resource settings can be changed through agentSessions. Controller and worker storage settings must identify the same bucket. The runtime API token and Operations token are stored in a separate per-session Kubernetes Secret. They are never part of the public session view or its S3 metadata. Controller suspension and replacement revoke the previous Operations token. An automatic idle exit leaves the terminal pod and its Secret until the next task or an explicit suspension cleans them up.

Run the project validation gate and chart checks, then build the runtime application. The local compatibility checks require no paid provider credential:

Terminal window
bun run --cwd apps/agent-runtime smoke
bun run --cwd apps/agent-runtime smoke:turn
bun run --cwd apps/agent-runtime smoke:delegation
bun run test:integration:agents

The first checks the real SDK initialization; the next two use a local scripted provider to verify actual shell execution, cold resume and native-child completion. The integration lane starts isolated Garage storage through Podman Compose and verifies real S3 behavior and checkpoint recovery after a storage restart, then tears the stack down. These checks have passed locally with the matching DSH/SDK rc.4 release. They establish integration behavior, not a real model’s handwriting or marking performance. With configured cluster storage and provider credentials, verify authenticated Operations MCP, real image/tool calls and a small exam sample before the cohort.

Packaged verification also passed all three DSH smoke commands in fresh tools-image containers with networking disabled and the final application package mounted read-only. This caught and fixed a missing shared native-loader alias in staging. The full workspace validation, all three frontend builds, API build and real Garage integration lane passed. Live model quality and the cluster’s own credentials/storage configuration remain deployment-trial inputs.

In each app, enable the local superuser interface and create an Agent Session. Upload a small PDF, ask the agent to render its pages into its workspace, and inspect the images and generated text through the file list. Start a task, close the browser, reopen the session, and verify the completed result. Suspend an idle session only after its checkpoint succeeds; the controller then removes its pod and credentials. Reopen it to test restoration into a fresh pod.

Also test a failed installation, an installation made through the shell, and a pod interruption. Check the retained installation ledger, dependency inventories, root/child conversations, attachments and files. An interrupted tool may already have produced an external effect; reconcile that effect before retrying it. A restored transcript does not restore an OS process.

Upload the original paper and a small sample of completed scripts first. Establish candidate/page grouping from the actual files and check that every expected page is present. Compare full-page and question-crop transcription against the handwriting, agree a versioned rubric with Anton, and calibrate item-level marks before processing all 45 scripts. Measure rendered-image and checkpoint size from that sample before the full 360-page run; agentSessions.maxCheckpointBytes forwards the worker’s AGENT_MAX_CHECKPOINT_BYTES limit (1 GiB by default) and can be raised for the measured workload.

Ask the agent to keep each script’s scans, transcription and report in a separate directory and retain earlier revisions. The workspace includes .emergent/marking-bundle-example.json; render-marking-bundle --input bundle.json --output outputs/revision-1 validates the structured marks and referenced files, computes totals and creates portable JSON, CSV, reports and source copies in a new output directory. Every script and source page remains inspectable. Use the selected file’s contextual chat for a correction; specify a shared rubric change explicitly when it should affect the cohort. Use another output revision for subsequent corrections.

Download the full Marking Bundle for archiving or the existing Git-managed output tree. The bundle format can be refined after the first exam. Canonical gradebook publication and missing-API feature requests remain later work.

Originals, transcriptions, rubric and marking revisions, installation evidence and session checkpoints stay in storage until explicitly deleted. Reconstructible scratch can be removed after a successful checkpoint. Suspend does not delete the S3 prefix. Preserve base-image identity and the resolved environment metadata needed to continue the work.

The runtime checkpoints and exits after 15 minutes idle by default (agentSessions.idleTimeoutMs, forwarded as AGENT_IDLE_TIMEOUT_MS). Active work is not stopped by this idle timer. The next task provisions a replacement and restores the last committed checkpoint. The idle-session suspend action releases a pod immediately. Merely listing or viewing saved sessions does not provision a pod; a missing pod whose last saved state was running is reported as interrupted. Partial checkpoint uploads must not replace the committed pointer. Inspect the runtime’s reported interrupted/error state before resuming effects.