Skip to content

Commit d785f52

Browse files
Terraphim CITerraphim AI
andcommitted
fix(symphony): add workspace cleanup and increase timeouts in WORKFLOWs
- Add `cargo clean` after successful merge in Rust WORKFLOWs to prevent disk space exhaustion (177GB across 8 workspaces in terraphim-private run) - Add `rm -rf node_modules` after successful merge in tlaplus-ts WORKFLOW - Increase hook timeout_ms from 600s to 1200s for Rust WORKFLOWs (cargo test --workspace exceeds 600s on large projects) - Increase stall_timeout_ms from 600s to 1200s for Rust WORKFLOWs Co-Authored-By: Terraphim AI <noreply@terraphim.io>
1 parent 3db5a27 commit d785f52

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/terraphim_symphony/examples/WORKFLOW-rust-genai.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ workspace:
2222
hooks:
2323
after_create: "git clone https://terraphim:${GITEA_TOKEN}@git.terraphim.cloud/terraphim/rust-genai.git . && cat > CLAUDE.md << CLAUDEEOF\n# rust-genai Agent Instructions\n\n## Your Task\nYou are implementing issue #${SYMPHONY_ISSUE_NUMBER} for the rust-genai Rust library.\nFocus ALL your effort on writing production-quality Rust code and tests.\nDo NOT run gitea-robot, tea, or any task-tracking commands.\nThe orchestrator handles all task tracking.\n\n## Project Overview\nrust-genai is a multi-AI provider Rust client library supporting OpenAI, Anthropic, Gemini,\nBedrock, Cerebras, DeepSeek, Groq, and more via a unified Adapter trait.\n\nThis is the Terraphim fork which adds: AWS Bedrock, Cerebras, Z.AI/Zhipu, OpenRouter adapters,\nand Bearer token authentication.\n\nThe fork needs to be synced with upstream v0.6.0-beta.8 which has breaking API changes.\n\n## Upstream Breaking Changes (v0.6.0-beta.8)\n- Adapter trait: added const DEFAULT_API_KEY_ENV_NAME: &str\n- Adapter trait: all_model_names now takes (kind, endpoint, auth) -- 3 params instead of 1\n- Adapter trait: default_auth() now returns AuthData (AuthData::None variant added)\n- ChatResponse: added stop_reason: Option<StopReason> field\n- InterStreamEnd: added captured_stop_reason: Option<StopReason> field\n- ChatMessage::tool renamed to ChatMessage::tool_response\n- ContentPart::ReasoningContent added alongside ContentPart::Text\n- ReasoningEffort::Max variant added\n- OpenRouter removed as dedicated adapter upstream (namespace dispatch only)\n- Aliyun adapter added upstream\n\n## Key Files\n- src/adapter/adapter_types.rs -- Adapter trait definition (source of truth for signatures)\n- src/adapter/adapter_kind.rs -- AdapterKind enum (all adapter variants)\n- src/adapter/dispatcher.rs -- Static dispatch to adapter implementations\n- src/resolver/auth_data.rs -- AuthData enum (BearerToken + None coexistence)\n- src/chat/chat_response.rs -- ChatResponse with stop_reason\n- src/adapter/inter_stream.rs -- InterStreamEnd with captured_stop_reason\n- src/adapter/adapters/bedrock/ -- Bedrock adapter (fork addition)\n- src/adapter/adapters/cerebras/ -- Cerebras adapter (fork addition)\n- src/adapter/adapters/openrouter/ -- OpenRouter adapter (fork addition)\n- src/adapter/adapters/zai/ -- Z.AI adapter (fork, has URL trailing slash issues)\n\n## Quality Requirements\n- cargo build must succeed\n- cargo test must pass\n- cargo clippy -- -D warnings must pass\n- cargo fmt -- --check must pass\n- Use British English in documentation\n- Never use mocks in tests\nCLAUDEEOF\ngit add CLAUDE.md && git commit -m 'chore: add agent CLAUDE.md with learnings' --no-verify 2>/dev/null || true"
2424
before_run: "set -e && git fetch origin && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && git checkout main 2>/dev/null || true && git branch -D \"$BRANCH\" 2>/dev/null || true && if git rev-parse --verify \"origin/$BRANCH\" >/dev/null 2>&1; then git checkout -b \"$BRANCH\" \"origin/$BRANCH\" && git fetch origin main && git rebase origin/main 2>/dev/null || { git rebase --abort 2>/dev/null; git merge -X theirs origin/main --no-edit 2>/dev/null || true; }; else git fetch origin main && git checkout -b \"$BRANCH\" origin/main; fi"
25-
after_run: "set +e && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && GITEA_API=\"https://git.terraphim.cloud/api/v1/repos/terraphim/rust-genai\" && AUTH=\"Authorization: token ${GITEA_TOKEN}\" && git add -A && git diff --cached --quiet || git commit -m \"symphony: ${SYMPHONY_ISSUE_IDENTIFIER} - ${SYMPHONY_ISSUE_TITLE}\" || true && git push -u origin \"$BRANCH\" 2>/dev/null || true && GATE=true && GATE_MSG=\"\" && RS_COUNT=$(find src -name '*.rs' 2>/dev/null | wc -l | tr -d ' ') && if [ \"$RS_COUNT\" -lt 1 ]; then GATE=false && GATE_MSG=\"No .rs files in src/. \"; fi && cargo build 2>/tmp/sym_build_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Build failed. \"; } && cargo test 2>/tmp/sym_test_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Tests failed. \"; } && cargo clippy -- -D warnings 2>/tmp/sym_clippy_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Clippy failed. \"; } && cargo fmt -- --check 2>/tmp/sym_fmt_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Format check failed. \"; } && if [ \"$GATE\" = \"true\" ]; then MERGE_OK=false && git fetch origin main && git checkout main && git pull origin main && git merge -X theirs \"$BRANCH\" --no-ff -m \"Merge ${SYMPHONY_ISSUE_IDENTIFIER}: ${SYMPHONY_ISSUE_TITLE}\" && git push origin main && MERGE_OK=true; if [ \"$MERGE_OK\" = \"true\" ]; then curl --retry 3 --retry-delay 5 --max-time 30 -sf -X PATCH -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"state\":\"closed\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}\" >/dev/null || true; curl --retry 3 --retry-delay 5 --max-time 30 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Quality gate passed (build+test+clippy+fmt). Merged to main and closed.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; else git checkout \"$BRANCH\" 2>/dev/null; curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Merge to main failed (concurrent merge race). Will retry.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi; else curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate failed: ${GATE_MSG}Issue left open for retry.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi"
26-
timeout_ms: 600000
25+
after_run: "set +e && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && GITEA_API=\"https://git.terraphim.cloud/api/v1/repos/terraphim/rust-genai\" && AUTH=\"Authorization: token ${GITEA_TOKEN}\" && git add -A && git diff --cached --quiet || git commit -m \"symphony: ${SYMPHONY_ISSUE_IDENTIFIER} - ${SYMPHONY_ISSUE_TITLE}\" || true && git push -u origin \"$BRANCH\" 2>/dev/null || true && GATE=true && GATE_MSG=\"\" && RS_COUNT=$(find src -name '*.rs' 2>/dev/null | wc -l | tr -d ' ') && if [ \"$RS_COUNT\" -lt 1 ]; then GATE=false && GATE_MSG=\"No .rs files in src/. \"; fi && cargo build 2>/tmp/sym_build_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Build failed. \"; } && cargo test 2>/tmp/sym_test_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Tests failed. \"; } && cargo clippy -- -D warnings 2>/tmp/sym_clippy_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Clippy failed. \"; } && cargo fmt -- --check 2>/tmp/sym_fmt_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Format check failed. \"; } && if [ \"$GATE\" = \"true\" ]; then MERGE_OK=false && git fetch origin main && git checkout main && git pull origin main && git merge -X theirs \"$BRANCH\" --no-ff -m \"Merge ${SYMPHONY_ISSUE_IDENTIFIER}: ${SYMPHONY_ISSUE_TITLE}\" && git push origin main && MERGE_OK=true; if [ \"$MERGE_OK\" = \"true\" ]; then curl --retry 3 --retry-delay 5 --max-time 30 -sf -X PATCH -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"state\":\"closed\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}\" >/dev/null || true; curl --retry 3 --retry-delay 5 --max-time 30 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Quality gate passed (build+test+clippy+fmt). Merged to main and closed.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; cargo clean 2>/dev/null || true; else git checkout \"$BRANCH\" 2>/dev/null; curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Merge to main failed (concurrent merge race). Will retry.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi; else curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate failed: ${GATE_MSG}Issue left open for retry.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi"
26+
timeout_ms: 1200000
2727

2828
codex:
2929
turn_timeout_ms: 3600000
30-
stall_timeout_ms: 600000
30+
stall_timeout_ms: 1200000
3131
---
3232
You are working on issue {{ issue.identifier }}: {{ issue.title }}.
3333

crates/terraphim_symphony/examples/WORKFLOW-terraphim-private.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ workspace:
2222
hooks:
2323
after_create: "git clone https://terraphim:${GITEA_TOKEN}@git.terraphim.cloud/zestic-ai/terraphim-private.git . && mkdir -p .docs"
2424
before_run: "set -e && git fetch origin && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && git checkout main 2>/dev/null || true && git branch -D \"$BRANCH\" 2>/dev/null || true && if git rev-parse --verify \"origin/$BRANCH\" >/dev/null 2>&1; then git checkout -b \"$BRANCH\" \"origin/$BRANCH\" && git fetch origin main && git rebase origin/main 2>/dev/null || { git rebase --abort 2>/dev/null; git merge -X theirs origin/main --no-edit 2>/dev/null || true; }; else git fetch origin main && git checkout -b \"$BRANCH\" origin/main; fi"
25-
after_run: "set +e && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && GITEA_API=\"https://git.terraphim.cloud/api/v1/repos/zestic-ai/terraphim-private\" && AUTH=\"Authorization: token ${GITEA_TOKEN}\" && git add -A && git diff --cached --quiet || git commit -m \"symphony: ${SYMPHONY_ISSUE_IDENTIFIER} - ${SYMPHONY_ISSUE_TITLE}\" || true && git push -u origin \"$BRANCH\" 2>/dev/null || true && GATE=true && GATE_MSG=\"\" && RS_COUNT=$(find crates -name '*.rs' 2>/dev/null | wc -l | tr -d ' ') && if [ \"$RS_COUNT\" -lt 1 ]; then GATE=false && GATE_MSG=\"No .rs files in crates/. \"; fi && cargo build 2>/tmp/sym_build_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Build failed. \"; } && cargo test 2>/tmp/sym_test_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Tests failed. \"; } && cargo clippy -- -D warnings 2>/tmp/sym_clippy_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Clippy failed. \"; } && cargo fmt -- --check 2>/tmp/sym_fmt_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Format check failed. \"; } && VMODEL_MSG=\"\" && if [ -f \".docs/verification-issue-${SYMPHONY_ISSUE_NUMBER}.md\" ]; then VMODEL_MSG=\"V-model verification present. \"; else VMODEL_MSG=\"WARNING: No verification artefact. \"; fi && if [ -f \".docs/validation-issue-${SYMPHONY_ISSUE_NUMBER}.md\" ]; then VMODEL_MSG=\"${VMODEL_MSG}V-model validation present. \"; else VMODEL_MSG=\"${VMODEL_MSG}WARNING: No validation artefact. \"; fi && if [ \"$GATE\" = \"true\" ]; then MERGE_OK=false && git fetch origin main && git checkout main && git pull origin main && git merge -X theirs \"$BRANCH\" --no-ff -m \"Merge ${SYMPHONY_ISSUE_IDENTIFIER}: ${SYMPHONY_ISSUE_TITLE}\" && git push origin main && MERGE_OK=true; if [ \"$MERGE_OK\" = \"true\" ]; then curl --retry 3 --retry-delay 5 --max-time 30 -sf -X PATCH -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"state\":\"closed\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}\" >/dev/null || true; curl --retry 3 --retry-delay 5 --max-time 30 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate passed (build+test+clippy+fmt). ${VMODEL_MSG}Merged to main and closed.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; else git checkout \"$BRANCH\" 2>/dev/null; curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Merge to main failed (concurrent merge race). Will retry.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi; else curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate failed: ${GATE_MSG}${VMODEL_MSG}Issue left open for retry.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi"
26-
timeout_ms: 600000
25+
after_run: "set +e && BRANCH=\"symphony/issue-${SYMPHONY_ISSUE_NUMBER}\" && GITEA_API=\"https://git.terraphim.cloud/api/v1/repos/zestic-ai/terraphim-private\" && AUTH=\"Authorization: token ${GITEA_TOKEN}\" && git add -A && git diff --cached --quiet || git commit -m \"symphony: ${SYMPHONY_ISSUE_IDENTIFIER} - ${SYMPHONY_ISSUE_TITLE}\" || true && git push -u origin \"$BRANCH\" 2>/dev/null || true && GATE=true && GATE_MSG=\"\" && RS_COUNT=$(find crates -name '*.rs' 2>/dev/null | wc -l | tr -d ' ') && if [ \"$RS_COUNT\" -lt 1 ]; then GATE=false && GATE_MSG=\"No .rs files in crates/. \"; fi && cargo build 2>/tmp/sym_build_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Build failed. \"; } && cargo test 2>/tmp/sym_test_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Tests failed. \"; } && cargo clippy -- -D warnings 2>/tmp/sym_clippy_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Clippy failed. \"; } && cargo fmt -- --check 2>/tmp/sym_fmt_${SYMPHONY_ISSUE_NUMBER}.log || { GATE=false; GATE_MSG=\"${GATE_MSG}Format check failed. \"; } && VMODEL_MSG=\"\" && if [ -f \".docs/verification-issue-${SYMPHONY_ISSUE_NUMBER}.md\" ]; then VMODEL_MSG=\"V-model verification present. \"; else VMODEL_MSG=\"WARNING: No verification artefact. \"; fi && if [ -f \".docs/validation-issue-${SYMPHONY_ISSUE_NUMBER}.md\" ]; then VMODEL_MSG=\"${VMODEL_MSG}V-model validation present. \"; else VMODEL_MSG=\"${VMODEL_MSG}WARNING: No validation artefact. \"; fi && if [ \"$GATE\" = \"true\" ]; then MERGE_OK=false && git fetch origin main && git checkout main && git pull origin main && git merge -X theirs \"$BRANCH\" --no-ff -m \"Merge ${SYMPHONY_ISSUE_IDENTIFIER}: ${SYMPHONY_ISSUE_TITLE}\" && git push origin main && MERGE_OK=true; if [ \"$MERGE_OK\" = \"true\" ]; then curl --retry 3 --retry-delay 5 --max-time 30 -sf -X PATCH -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"state\":\"closed\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}\" >/dev/null || true; curl --retry 3 --retry-delay 5 --max-time 30 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate passed (build+test+clippy+fmt). ${VMODEL_MSG}Merged to main and closed.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; cargo clean 2>/dev/null || true; else git checkout \"$BRANCH\" 2>/dev/null; curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d '{\"body\":\"Merge to main failed (concurrent merge race). Will retry.\"}' \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi; else curl --retry 2 --max-time 15 -sf -X POST -H \"$AUTH\" -H 'Content-Type: application/json' -d \"{\\\"body\\\":\\\"Quality gate failed: ${GATE_MSG}${VMODEL_MSG}Issue left open for retry.\\\"}\" \"${GITEA_API}/issues/${SYMPHONY_ISSUE_NUMBER}/comments\" >/dev/null || true; fi"
26+
timeout_ms: 1200000
2727

2828
codex:
2929
turn_timeout_ms: 3600000
30-
stall_timeout_ms: 600000
30+
stall_timeout_ms: 1200000
3131
---
3232
You are working on issue {{ issue.identifier }}: {{ issue.title }}.
3333

0 commit comments

Comments
 (0)