Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

FEAT-145: Improve cloud failure handling in symphony loop - #41

Merged
shafty023 merged 3 commits into
mainfrom
symphony/019d2550-285a-725c-ab41-5b42570a7cc3
Mar 25, 2026
Merged

FEAT-145: Improve cloud failure handling in symphony loop#41
shafty023 merged 3 commits into
mainfrom
symphony/019d2550-285a-725c-ab41-5b42570a7cc3

Conversation

@closedloop-ai

@closedloop-ai closedloop-ai Bot commented Mar 25, 2026

Copy link
Copy Markdown

Summary

  • Return structured results from postLoopEvent and uploadArtifacts (replacing void) so callers can detect HTTP/network failures and accumulate warnings
  • Refactor executeGitOperations to use a discriminated union GitOperationResult (success | no-changes | error) replacing the null return pattern
  • Exclude .claude/ from git status --porcelain check so gateway work-dir files are never accidentally committed during EXECUTE loops
  • Add sanitizeErrorMessage() to redact tokens/secrets from error strings before storing them in the job store
  • Persist failure warnings (ARTIFACT_UPLOAD_FAILED, EVENT_POST_FAILED, GIT_PUSH_FAILED, LLM commit timeout) to the job store warning field
  • Promote several debug-level gateway log calls to info for better observability
  • Add integration tests for cloud failure scenarios (T-4.2): artifact upload failure and event post failure reflected in job store warnings
  • Bump package version to 0.8.6

Test plan

  • Run just desktop-test — existing symphony-loop-execute tests pass
  • New symphony-loop-cloud-failures.test.ts tests pass (artifact upload failure, event post failure)
  • just desktop-typecheck and just desktop-lint pass

🤖 Generated with Claude Code

- Return structured results from postLoopEvent and uploadArtifacts instead of void,
  enabling callers to detect and log HTTP/network failures
- Refactor executeGitOperations to use a discriminated union GitOperationResult
  (success | no-changes | error) replacing the null return pattern
- Exclude .claude/ from git status porcelain check to prevent gateway work-dir
  files from being committed during EXECUTE loops
- Accumulate warnings array (ARTIFACT_UPLOAD_FAILED, EVENT_POST_FAILED,
  GIT_PUSH_FAILED, LLM commit timeout) and persist to job store warning field
- Add sanitizeErrorMessage() to redact tokens/secrets from error strings before
  storing them in the job store
- Promote several debug-level gateway log calls to info for better observability
- Add integration tests for cloud failure scenarios (T-4.2): artifact upload
  failure and event post failure are reflected in job store warnings
- Bump package version to 0.8.6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread apps/desktop/test/symphony-loop-cloud-failures.test.ts Outdated
Comment thread apps/desktop/test/symphony-loop-cloud-failures.test.ts Outdated
Comment thread apps/desktop/test/symphony-loop-cloud-failures.test.ts Outdated
Comment thread apps/desktop/test/symphony-loop-cloud-failures.test.ts
@closedloop-ai-stage

Copy link
Copy Markdown

Code Review Summary

Status: Approved

Reviewers: Bug Hunter A, Bug Hunter B, Unified Auditor, Premise Reviewer, cloud-command-executor-specialist

Findings

Severity Count
Blocking 0
High 0
Medium 4

MEDIUM Issues (consider)

  1. [P2] [symphony-loop-cloud-failures.test.ts:384] 5+ test helpers duplicated from symphony-loop-execute.test.ts
  2. [P2] [symphony-loop-cloud-failures.test.ts:205] waitForCompletedEvent duplicated verbatim
  3. [P2] [symphony-loop-cloud-failures.test.ts:165] waitForRequest timer does not remove stale waiter on timeout
  4. [P2] [symphony-loop-cloud-failures.test.ts:108] void async IIFE silently swallows mock server handler exceptions

Validation Stats

  • Agent failures: 0 partitions skipped
  • Cross-file grouped: 1 finding consolidated
  • Duplicates merged: 1

Recommendation: Consider extracting shared test helpers before merging.

- Extract shared test helpers into symphony-test-utils.ts
  (initGitRepo, startMockApiServer, createFakeRunLoopScript,
  waitForCompletedEvent, saveEnv/restoreEnv)
- Fix waitForRequest: remove stale waiter from array on timeout
- Fix async IIFE in mock server: add .catch() handler to surface
  errors instead of silently swallowing them

Testing: typecheck and lint pass
Risks: low, test-only changes
@shafty023
shafty023 merged commit 7adfe5b into main Mar 25, 2026
2 checks passed
@shafty023
shafty023 deleted the symphony/019d2550-285a-725c-ab41-5b42570a7cc3 branch March 25, 2026 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants