Repository navigation
feat(mesh): worker nodes run jobs as their own user of the database, with files over the mesh - #595
Merged
Merged
Conversation
…with files over the mesh Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GTrHPwWHtEvFJFq3M1YpH4
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GTrHPwWHtEvFJFq3M1YpH4
adeelahmad
force-pushed
the
claude/project-thread-6dqeie
branch
from
October 18, 2026 12:27
8d56af8 to
453211e
Compare
…un lens worker Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GTrHPwWHtEvFJFq3M1YpH4
This was referenced Oct 18, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before: a machine that joined as a worker node sat on the mesh and did nothing. Auto scaling's cloud machines joined, then had nothing to run.
After: on a worker node,
lens nodealso runslens workerand keeps it running. The worker uses this install's database over the mesh, signed in as a database user made only for that node, never the server's root. Its jobs fetch their files from the primary over the mesh, as plain bytes (GET /api/v1/mesh/node/media/{id}, cached on the node with an ETag), and a vault's files never leave the primary. The node never gets the archive's secret, so it runstranscribeanddiarizewith that machine's models and skips any other stepLENS_WORKER_STEPSnames. A worker that serves some namespaces takes only their jobs. An auto scaling group on machines elsewhere counts only the jobs a worker node takes, so it never launches a paid machine for work that machine wouldn't run.How:
mesh.grant_database/revoke_databasegive each worker node its own owner user on Lens's one database (DEFINE USER … ON DATABASE). The user is removed with the node and made again with a new password on undo.GET /api/v1/mesh/node/workerhands the node its credentials, which go only into the worker's environment. They are not written to the node's disk.SURREAL_AUTH=databasemakes the store sign in at database level.jobs.claimfilters by the node's namespaces.scaling.unit_stepsnarrows a joining group's queue metrics. The group showsunit_steps, andwaiting_forsays when none of its steps can run on a node.Motivation and Context
Part of the Nebula network with a Nodes settings page. This follows #553 (the mesh container) and #591 (another machine joins as a node). Settings › Nodes and Network comes next.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/mesh-workers.md.Done questions (AGENTS.md)
unit_stepsandwaiting_forover the API, MCP and the assistant.LENS_JOINsets it all up. No new prerequisite.LENS_WORKER_STEPSnarrows the steps. Settings › Nodes (next PR) shows each worker's state and log.test_mesh_workers.py,test_a_group_elsewhere_counts_only_the_jobs_a_node_takes), docs andmake openapioutput updated.lens worker,jobs.claim,keyring.open_plainand the scaling metrics.Generated by Claude Code