Repository navigation
fix(app-conversations): reinstall git credential helpers after a sandbox resume (OHE-3896) - #1201
Merged
hieptl merged 1 commit intoNov 5, 2026
Conversation
…box resume (OHE-3896) The per-provider git credential helpers, their global git config and the exchange JWTs they read live under the sandbox $HOME. A paused Kubernetes sandbox loses that directory: resume gives it a new pod on the same volumes, and the JWTs would have expired after 12 hours anyway. The agent server reloads auto-load marketplaces and plugins on the first message after a resume, and without a helper a private marketplace cannot be cloned again, so its sub-agents and hooks were silently lost while the skills survived in the persisted state. On resume, mint fresh exchange JWTs for the sandbox's owner, install the helpers the way conversation start does, and register the JWTs for output masking in every conversation the sandbox hosts, next to the git identity restore that already runs there. The catalog paging the Codex rebinding does is shared for that. Best effort, like the start-time setup: a failure is logged and never blocks the identity restore. Tests cover the owner-scoped restore from the post-resume task, a failing restore leaving the identity restore in place, the fresh JWTs reaching both helper installs, the masking update per conversation, and the no-callback case.
hieptl
marked this pull request as ready for review
November 5, 2026 06:36
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
hieptl
deleted the
hiep/ohe-3896-reinstall-git-credential-helpers-on-resume
branch
November 5, 2026 13:28
Contributor
|
🚀 Released in 1.87.0. |
2 of 6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
HUMAN:
AGENT:
Why
A private marketplace registered with auto-load is cloned twice. The app server clones it with an authenticated URL for
/api/skills, which yields skills only. Sub-agents and hooks come from the clone the SDK does inside the sandbox from the bareregistered_marketplacessource, and that clone authenticates only through the git credential helper installed in the sandbox's global git config at conversation start (#1064).The helper, its git config and the exchange JWTs it reads live under
$HOME. On Kubernetes and runtime-api sandboxes that directory is container-local: pause deletes the pod and resume creates a new one on the same volumes (/workspace,/var/openhands), so they are gone. The JWTs would have expired after 12 hours anyway. The SDK plugin cache under~/.openhands/cache/pluginsis gone too, and the agent server rehydrates the conversation and re-fetches every marketplace on the first message after a resume. That clone has no credentials, so the marketplace's sub-agents and hooks disappear while its skills survive in the persisted state. Idle conversations are paused routinely, so this is the normal path for a customer whose plugin relies on sub-agents and hooks (OHE-3896).The post-resume task restored only the git identity and the Codex credential bindings.
Summary
SandboxUserContext, as the webhook router does.POST /api/conversations/{id}/secrets, reusing the catalog paging the Codex rebinding already does (now a sharediter_sandbox_conversations).Issue Number
Linear OHE-3896.
How to Test
The five new tests fail on
mainand pass with this change:test_post_resume_task_reinstalls_git_credentials_for_the_sandbox_owner: the task resolves the owner's context and calls the restore with the resumed sandbox and its workspace.test_post_resume_task_keeps_the_identity_when_restoring_credentials_fails: a failing restore is logged; the identity restore and the Codex rebinding still happen.test_restore_git_credentials_after_resume_reinstalls_the_helpers_with_fresh_jwts: one JWT per provider reaches_configure_git_credential_helpers, the Azure DevOps one reaches its own install.test_restore_git_credentials_after_resume_masks_the_jwts_in_every_conversation: each conversation in the agent server's catalog receives the secrets update with the sandbox's session key.test_restore_git_credentials_after_resume_leaves_the_sandbox_alone_without_a_callback_url: nothing is installed or pushed when the sandbox cannot call back.To check on a running stack: start a conversation with a private auto-load marketplace that carries a sub-agent and a SessionStart hook, confirm delegation and the hook, then
POST /api/v1/sandboxes/{id}/pause, resume, and send a message. The sub-agents and hooks should still be there, and in the sandboxgit config --global --get credential.https://<host>.helpershould be set again. I did not run this end to end here.Video/Screenshots
Backend only; no UI change. Test output is in How to Test.
Type
Notes
Enterprise server image for this PR: