feat: inject workspace config into daemon sessions#86
Conversation
When a daemon is linked to a workspace, inject PAWS_WORKSPACE_* env vars into the session workload: name, type, repo, branch, root dir, clone URL, language, package manager, test/build commands. Works for both webhook triggers and GitHub PR triggers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request adds workspace-aware environment injection into session and workload dispatch. A new helper function computes workspace-derived environment variables (including repository details and build/test commands) and injects them into workload environments during session creation for both daemon-triggered and GitHub webhook-triggered sessions. Type definitions are updated to include an optional Changes
Sequence DiagramsequenceDiagram
actor Webhook as GitHub Webhook
participant ControlPlane as Control Plane
participant WorkspaceStore as Workspace Store
participant SessionMgr as Session Manager
Webhook->>ControlPlane: POST /v1/webhooks/github
ControlPlane->>WorkspaceStore: Lookup workspace (daemon.workspace)
alt Workspace Found
WorkspaceStore-->>ControlPlane: Workspace config + repos
ControlPlane->>ControlPlane: injectWorkspaceEnv()<br/>(compute PAWS_WORKSPACE_*)
ControlPlane->>ControlPlane: Merge into workload.env
else Workspace Not Found
WorkspaceStore-->>ControlPlane: null/undefined
ControlPlane->>ControlPlane: Return original env unchanged
end
ControlPlane->>SessionMgr: Create sessionRequest<br/>with enriched workload.env
SessionMgr-->>ControlPlane: Session created
ControlPlane-->>Webhook: Success response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Deploying getpaws with
|
| Latest commit: |
4d194fc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0006e4cd.getpaws-6m4.pages.dev |
| Branch Preview URL: | https://feat-workspace-session-injec.getpaws-6m4.pages.dev |
Summary
When a daemon is linked to a workspace, session env vars are now injected:
For multi-repo workspaces, also injects
PAWS_WORKSPACE_REPOS(comma-separated).Works at both dispatch sites: webhook/schedule triggers and GitHub PR triggers.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit