-
Notifications
You must be signed in to change notification settings - Fork 18
fix: align dev-stack OH_PERSISTENCE_DIR and automation DB path with Docker #960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tofarr
wants to merge
4
commits into
main
Choose a base branch
from
fix/dev-docker-state-path-alignment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2a1221c
fix: align dev-stack OH_PERSISTENCE_DIR and automation DB path with D…
openhands-agent eeb3f52
fix: use dev_conversations dir for npm to isolate from Docker convers…
openhands-agent 83b0baf
fix: use join(config.stateDir, dev_conversations) in ensureDirectories
openhands-agent b8c93c3
test: update conversationsPath assertion to match dev_conversations
openhands-agent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,10 +381,12 @@ function checkPrerequisites({ checkFrontendDependencies = true } = {}) { | |
| function ensureDirectories(config) { | ||
| const dirs = [ | ||
| config.stateDir, | ||
| join(config.stateDir, "conversations"), | ||
| join(config.stateDir, "dev_conversations"), | ||
| join(config.stateDir, "workspaces"), | ||
| join(config.stateDir, "bash_events"), | ||
| join(config.stateDir, "storage"), | ||
| // Automation DB directory — matches docker/entrypoint.sh mkdir -p behaviour. | ||
| dirname(join(dirname(config.stateDir), SHARED_DEFAULTS.paths.automationDb)), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit — nested is slightly hard to parse at a glance. Since , the directory is always the fixed segment relative to the parent of . The double-dirname wrapping is correct, but this reads more clearly as: or simply with a short comment. Non-blocking. |
||
| ]; | ||
|
|
||
| for (const dir of dirs) { | ||
|
|
@@ -589,7 +591,8 @@ function startAutomationBackend(config) { | |
| } | ||
| : {}), | ||
| AUTOMATION_AGENT_SERVER_API_KEY: config.sessionApiKey, | ||
| AUTOMATION_DB_URL: `sqlite+aiosqlite:///${join(config.stateDir, "automations.db")}`, | ||
| // ~/.openhands/automation/automations.db — matches docker/entrypoint.sh. | ||
| AUTOMATION_DB_URL: `sqlite+aiosqlite:///${join(dirname(config.stateDir), SHARED_DEFAULTS.paths.automationDb)}`, | ||
| // The automation backend uses this as its publicly-reachable base | ||
| // URL: it's appended to callback URLs and injected into each | ||
| // sandbox as `AUTOMATION_API_URL` (consumed by setup.sh for | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor — conversations path is duplicated in instead of reading from .
(built in ) already holds . Both here and the identical expression at line 560 will drift silently if the subdirectory name ever changes in . Not a bug today, but worth keeping in mind for a follow-up if is ever refactored to expose a canonical .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OpenHands read this comment above, you will notice that it seems to miss words. Clone yourself the automations/ repo in the same org, and any other repo you may need, and try to understand what is the problem. Some quoting issue? Some eaten characters? It’s very likely recent so maybe find the agent that posts this (cloud automation pr review agent) and investigate to find the cause. Respond directly on github in a reply to me, and mention me so I can see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on it! enyst can track my progress at all-hands.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enyst I traced this and it looks like a shell heredoc quoting bug in the review-posting step, not GitHub rendering and not the automation DB/service code.
What I found:
backticks == 0on this review), so the text was mangled before submission.becomes:
{"body":"use built in "}because bash treats backticks inside an unquoted heredoc as command substitution. The attempted substitutions fail, but
catstill exits 0, so the agent can proceed togh api ... --input /tmp/review.jsonand post a damaged review.I cloned
OpenHands/automationand related repos;automationis dispatching/running the automation, while the damaged payload is consistent with the Cloud Automation PR review agent creating a JSON review file in the shell before calling the GitHub reviews API. The fix/guardrail is to make that path always use a quoted delimiter (<<'EOF', as thegithub-pr-reviewskill already recommends) or generate JSON via Python/jq/raw files instead of an unquoted shell heredoc. A simple regression check would be: review bodies containing`SENTINEL`must still contain that text in/tmp/review.jsonbefore posting.This reply was generated by an AI agent (OpenHands) on behalf of the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final summary:
OpenHands/automationplus related OpenHands review/integration repositories.<< EOF) strips Markdown backtick spans because bash treats them as command substitutions before writing the JSON review payload.@enyst, with the root-cause analysis and recommended mitigation:<<'EOF'),GitHub reply: #960 (comment)