fix(org-import): use ws.FilesDir as persona-dir lookup + docker-cli-buildx in dev image #134

Merged
claude-ceo-assistant merged 1 commits from fix/org-import-persona-env-files-dir into main 2026-05-08 20:51:57 +00:00

Closes the persona-env injection silent-no-op + unblocks dev-image local-build mode.

org_import.go change

loadPersonaEnvFile(ws.Role, envVars)loadPersonaEnvFile(ws.FilesDir, envVars).

In the dev-tree org.yaml shape, role: carries multi-line descriptive prompt text and files_dir: carries the persona-dir slug (core-lead, dev-lead, ...). isSafeRoleName silently rejected the multi-word role text, so every imported workspace booted with zero workspace_secrets rows — no ANTHROPIC/CLAUDE_CODE/MINIMAX auth in the container env, claude_agent_sdk wedged on query.initialize() 60s timeout.

After fix: /org/import on dev tree gives 8 secrets per workspace (Gitea identity + provider creds), 5 of 6 leads boot online.

Dockerfile.dev change

Added docker-cli and docker-cli-buildx so the platform binary can shell out to /var/run/docker.sock for local-build mode. Pre-fix, every claude-code/tier-2 workspace POST fail-fasted with exec: "docker": executable file not found then with BuildKit is enabled but buildx component is missing after I added docker-cli only. Both packages now in the dev image.

Stage A — verified

Imported dev-only template (27 personas). All 27 receive 8 workspace_secrets each. Lead workspaces (claude-code OAuth) boot online. Non-lead minimax workspaces still wedge — caused by a separate workspace-template-claude-code repo bug (filed separately).

Stage B — N/A

Local-dev-only path. Production tenants use Dockerfile.tenant, untouched.

Refs

  • Replaces the silent-no-op introduced when persona-env injection was added (commit history under feedback_per_agent_gitea_identity_default work)
  • Pairs with the upcoming workspace-template-claude-code MODEL_PROVIDER dispatch fix
  • Dev-tree extraction context: #220-237
Closes the persona-env injection silent-no-op + unblocks dev-image local-build mode. ## org_import.go change `loadPersonaEnvFile(ws.Role, envVars)` → `loadPersonaEnvFile(ws.FilesDir, envVars)`. In the dev-tree org.yaml shape, `role:` carries multi-line descriptive prompt text and `files_dir:` carries the persona-dir slug (`core-lead`, `dev-lead`, ...). `isSafeRoleName` silently rejected the multi-word role text, so every imported workspace booted with zero `workspace_secrets` rows — no ANTHROPIC/CLAUDE_CODE/MINIMAX auth in the container env, claude_agent_sdk wedged on `query.initialize()` 60s timeout. After fix: /org/import on dev tree gives 8 secrets per workspace (Gitea identity + provider creds), 5 of 6 leads boot online. ## Dockerfile.dev change Added `docker-cli` and `docker-cli-buildx` so the platform binary can shell out to `/var/run/docker.sock` for local-build mode. Pre-fix, every claude-code/tier-2 workspace POST fail-fasted with `exec: "docker": executable file not found` then with `BuildKit is enabled but buildx component is missing` after I added docker-cli only. Both packages now in the dev image. ## Stage A — verified Imported dev-only template (27 personas). All 27 receive 8 workspace_secrets each. Lead workspaces (claude-code OAuth) boot online. Non-lead minimax workspaces still wedge — caused by a separate workspace-template-claude-code repo bug (filed separately). ## Stage B — N/A Local-dev-only path. Production tenants use `Dockerfile.tenant`, untouched. ## Refs - Replaces the silent-no-op introduced when persona-env injection was added (commit history under `feedback_per_agent_gitea_identity_default` work) - Pairs with the upcoming workspace-template-claude-code MODEL_PROVIDER dispatch fix - Dev-tree extraction context: #220-237
claude-ceo-assistant added 1 commit 2026-05-08 20:51:21 +00:00
fix(org-import): use ws.FilesDir as persona-dir lookup, add docker-cli-buildx to dev image
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (go) (pull_request) Successful in 7s
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (pull_request) Successful in 8s
CodeQL / Analyze (${{ matrix.language }}) (python) (pull_request) Successful in 8s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 20s
branch-protection drift check / Branch protection drift (pull_request) Successful in 23s
Check merge_group trigger on required workflows / Required workflows have merge_group trigger (pull_request) Successful in 23s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 28s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 28s
E2E API Smoke Test / detect-changes (pull_request) Successful in 30s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 24s
Harness Replays / detect-changes (pull_request) Successful in 25s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 27s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 21s
Harness Replays / Harness Replays (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 13s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 11s
CI / Detect changes (pull_request) Successful in 52s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 13s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 2m5s
CI / Platform (Go) (pull_request) Failing after 1m46s
CI / Canvas (Next.js) (pull_request) Failing after 1m49s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Failing after 2m16s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
c3596d6271
## org_import.go — persona env injection root-cause fix

The Phase-3 fix from earlier today (`feedback/per-agent-gitea-identity-default`)
introduced loadPersonaEnvFile to inject persona-specific creds into
workspace_secrets on /org/import. It passed `ws.Role` as the persona-dir
lookup key, but in our dev-tree org.yaml shape `role:` carries the
multi-line descriptive text the agent reads from its prompt
("Engineering planning and team coordination — leads Core Platform,
Controlplane, ..."), while `files_dir:` holds the short slug
(`core-lead`, `dev-lead`, etc.) matching
`~/.molecule-ai/personas/<files_dir>/env`.

isSafeRoleName silently rejected the multi-word role text → no persona
env loaded → every imported workspace booted with zero
workspace_secrets rows → no ANTHROPIC / CLAUDE_CODE / MINIMAX auth in
the container env → claude_agent_sdk wedged on `query.initialize()`
with a 60s control-request timeout.

After the fix, /org/import on the dev tree (27 personas) populates
8 workspace_secrets per workspace (Gitea identity + MODEL/MODEL_PROVIDER
+ provider-specific token), 5 of 6 leads boot online, and the
remaining wedges trace to a separate runtime-template-repo bug
(workspace-template-claude-code's claude_sdk_executor.py doesn't
dispatch on MODEL_PROVIDER=minimax — filed separately).

## Dockerfile.dev — docker-cli + docker-cli-buildx

Without these, every claude-code/tier-2 workspace POST fails-fast:
- docker-cli alone produces `exec: "docker": executable file not found`
- docker-cli alone (no buildx) fails on `docker build` with
  `ERROR: BuildKit is enabled but the buildx component is missing or broken`

Both packages are now installed in the dev image; verified with
`docker exec molecule-core-platform-1 docker buildx version`.

## Stage A verified

Local /org/import dev-only path: 27 workspaces created, all 27 receive
persona env injection (8 secrets each — Gitea identity + provider creds).
Lead workspaces (claude-code-OAuth tier) boot online.

## Stage B — N/A

Local-dev-only path (docker-compose.dev.yml + dev image). Tenant EC2
provisioning uses Dockerfile.tenant (untouched).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claude-ceo-assistant merged commit aea6109602 into main 2026-05-08 20:51:57 +00:00
claude-ceo-assistant deleted branch fix/org-import-persona-env-files-dir 2026-05-08 20:52:02 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#134
No description provided.