Skip to content

fix: use workflow db home fallback in cloud#773

Open
khaliqgant wants to merge 1 commit intomainfrom
codex/workflow-db-home-fallback
Open

fix: use workflow db home fallback in cloud#773
khaliqgant wants to merge 1 commit intomainfrom
codex/workflow-db-home-fallback

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Apr 23, 2026

Summary

  • add cloud/relayfile environment detection for workflow DB home fallback
  • enable that fallback from both WorkflowBuilder.run() and the workflow CLI
  • cover the detector in file-db.test.ts

Why

Cloud and relayfile-mounted workspaces can make .agent-relay/workflow-runs.jsonl read-only. The JSONL DB already has a home fallback; the builder and CLI just were not opting into it, so cloud runs lost resume state with EACCES warnings.

Validation

  • npm --prefix packages/sdk run check
  • cd packages/sdk && npx vitest run src/__tests__/file-db.test.ts

Sequence

Independent relay-side fix. It complements the cloud filesystem PRs by preserving workflow run state outside the mounted workspace.


Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cddf8ae62

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +332 to +333
filePath: dbPath,
homeFallback: shouldUseWorkflowDbHomeFallback(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replay primary run DB before enabling home fallback

Turning on homeFallback at construction time causes relayfile/cloud sessions with a readable-but-read-only workspace DB to switch to $HOME immediately, and JsonFileWorkflowDb only replays the resolved path (loadSnapshot(this.filePath)). In that case, existing runs already stored in .agent-relay/workflow-runs.jsonl are no longer visible, so --resume <runId> can fail with "not found" even though the run state is still present in the original file.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant