Spike: run scheduled jobs through Sandcastle on Windows
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, powershell, typescript
Hướng nghiên cứu
Start with skills/report/scripts/schedule.mjs to see how claude -p is spawned today, and skills/report/scripts/report.mjs for the host-side report port. In a scratch repo run npx @ai-hero/sandcastle init, create .sandcastle/main.ts and .sandcastle/Dockerfile, then run npx tsx .sandcastle/main.ts in PowerShell and, if needed, WSL. Done means all seven checks have recorded pass/fail, command, environment and workaround, with the template files pushed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Scheduled runs should run the agent in a container through Sandcastle, not with claude -p on the host. Then the agent can run without permission limits and without auto mode on the PC. This issue is a spike on the Windows PC. It answers the questions that decide how big the runner rewrite is. Run it on Windows, because Windows is the main target and Sandcastle doesn't say whether it supports Windows.
Background
gstack has three layers, and Sandcastle takes over the middle one.
- What the agent knows. This is skills, playbooks and principles. gstack owns it.
scripts/build.mjsrenders it for each harness intodist/<harness>. - How the agent runs. This means starting the agent, isolating it, injecting the prompt and secrets, enforcing the timeout, collecting the result and cleaning up. Today
skills/report/scripts/schedule.mjsdoes it withclaude -p. Sandcastle'srun()does it with anagentprovider (claudeCode,codex,opencodeand others) and asandboxprovider (docker,podman,vercel,noSandbox). - What reaches the user. This is the report port and its Telegram adapter,
skills/report/scripts/report.mjs. gstack owns it, and it stays on the host.
The plan is a job spec run by a deterministic runner. A job spec holds the name, schedule, repo, branch strategy, harness, model, prompt or skill, timeout and report adapter. The OS scheduler starts the runner. The runner reads the spec, runs Sandcastle, and always sends a report afterwards, even when the run fails. gstack stays dependency-free. Instead of importing Sandcastle, it ships a template .sandcastle/main.ts and a Dockerfile snippet that live in the user's project.
Setup
WSL2 and Docker Desktop already run on the PC. Before starting:
- In Docker Desktop, turn on Settings > General > "Start Docker Desktop when you sign in". Scheduled runs need Docker running.
- Run
npx @ai-hero/sandcastle initin a scratch repo. - Run
claude setup-token. This needs a browser, so a human does it. Put the token in.sandcastle/.envasCLAUDE_CODE_OAUTH_TOKEN, and check that.sandcastle/.envis gitignored. - Make sure
ANTHROPIC_API_KEYis set nowhere. Claude Code uses it ahead of the OAuth token, and in-pit always uses it. The run would then bill at API rates instead of using the subscription. Also don't pass--bare, because bare mode ignoresCLAUDE_CODE_OAUTH_TOKEN. Both rules are in the authentication docs.
Checks
Run each check from Windows PowerShell first. If Sandcastle fails there on paths or the shell, repeat the check inside WSL Ubuntu, and record which one worked.
- Sandcastle runs on Windows.
npx tsx .sandcastle/main.tswith a trivial prompt finishes and returns aRunResult. - The subscription is used. In the run's output or session file, the auth method is the OAuth token, not an API key.
- gstack skills load in the container. Add steps to
.sandcastle/Dockerfilethat copy indist/claude-code(fromnpm run build) and runclaude plugin marketplace add <dir>andclaude plugin install gstack@gstack. Rebuild withsandcastle docker build-image. A prompt that starts with/gstack:reportor/gstack:go-modeshould load the skill in print mode. Don't mount the host~/.claude, because it holds the login and the history. - The report comes back as structured output. Use
output: Output.object(<report schema>)withmaxIterations: 1. The schema takes the report fields, which are title, status (done,running,blocked,failed), summary, completed, blockers, next and links.run()returns the report. Pipe it intoreport.mjson the host to send it to Telegram. - The Telegram token stays out of the container. With
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDset in the host shell, list the environment inside the container withenvin asandbox.onSandboxReadyhook. Neither variable should appear. The README says sandbox env comes from.sandcastle/.envandprocess.env, and doesn't say whether it passes the whole environment. - An abort removes the container. Start a run that hangs, abort it through
signal, then rundocker ps -a. No container from the run should be left. Repeat by killing the node process from outside, which is whatschedule.mjsdoes today on timeout, and record whether that leaves the container behind. - Branch strategy.
branchStrategy: { type: "branch", branch: "gstack/<job>" }leaves the agent's commits on that branch and leaves the checked-out branch unchanged.
Done when
Each of the 7 checks has a recorded result, either in a comment here or in a short doc. Record pass or fail, the command run, PowerShell or WSL, and any workaround. The template main.ts and Dockerfile used for the checks are attached or pushed to a branch.
Out of scope
- The runner rewrite itself. It is a follow-up issue sized from these results. It adds the job spec, swaps the
claude -pspawn inschedule.mjsfor the Sandcastle script, and keeps the fallbackfailedreport and the retry rules. - Inbound commands from Telegram. That is a separate port, with its own security questions.
- Our own sandbox or agent providers.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- JavaScript
- Star
- 0
- Fork
- 0
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 37
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gregogun/gstack
-
enhancement ready-for-agent
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
gregogun/gstack#50 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
gregogun/gstack#48 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
npm test runs 0 tests on WindowsCó thể đã có người làm @gregogun đã nhận 10 ngày trước. Đang mởbug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của gregogun/gstack
Issue tương tự
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage potential-regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws/aws-sdk-js-v3#8408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyĐang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100