fix(template): 修复模板员工部署回看与访问#266
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5d1eb1180
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Instance.deleted_at.is_(None), | ||
| Instance.org_id == org_id, |
There was a problem hiding this comment.
Allow deploy progress replay after soft-deleting instance
The new access check now requires Instance.deleted_at.is_(None) before serving progress, so once a failed/canceled deployment triggers cleanup and the instance is soft-deleted, /progress/{deploy_id} returns 404 even though DeployRecord still exists and get_deploy_progress_snapshot can replay terminal status. This breaks the newly added “reopen progress page” behavior specifically for deployments whose instance was already cleaned up.
Useful? React with 👍 / 👎.
| selected_specs: list[dict] = [] | ||
| for idx in selected_indices: | ||
| spec = deepcopy(all_agent_specs[idx]) | ||
| new_coord = position_by_index[idx] |
There was a problem hiding this comment.
Handle legacy workspace deploy records without agent_positions
_run_deploy_pipeline_inner defaults agent_positions to [], then _build_agent_specs_with_layout unconditionally indexes position_by_index[idx]. For any in-flight/queued WorkspaceDeploy created before this commit (no agent_positions in config_snapshot), this raises KeyError and the pipeline is marked failed instead of continuing with template coordinates, causing upgrade-time regressions for existing deploy jobs.
Useful? React with 👍 / 👎.
变更说明
验证
DEBUG=true DATABASE_URL=postgresql+asyncpg://nodeskclaw_test:nodeskclaw_test@127.0.0.1:55432/nodeskclaw_test .venv/bin/pytest tests/test_deploy_service_docker_urls.py tests/test_k8s_resource_builder.py.venv/bin/ruff check app/api/deploy.py app/api/portal/deploy.py app/services/deploy_service.py app/services/k8s/resource_builder.py tests/test_deploy_service_docker_urls.py tests/test_k8s_resource_builder.pynpm run buildEchoFinalTest0525151522验证:外部/healthz返回 200,详情页显示 SOUL/AGENT/echo 技能,部署进度回看显示成功。