Skip to content

feat(parser): migrate openhands provider#768

Draft
mariusvniekerk wants to merge 1 commit into
provider-qwenpawfrom
provider-openhands
Draft

feat(parser): migrate openhands provider#768
mariusvniekerk wants to merge 1 commit into
provider-qwenpawfrom
provider-openhands

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

OpenHands now has a concrete provider facade for conversation directories under the configured conversations root.

The provider preserves legacy direct-child discovery, shallow watch planning, dashed and undashed raw-ID lookup, component-file changed-path classification, composite snapshot fingerprinting over base_state.json/TASKS.json/events/*.json, and normalized parse output from the existing OpenHands parser.

@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (c6710fd)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 3m31s), codex_security (codex/security, done, 1m39s) | Total: 5m10s

@roborev-ci

roborev-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown

roborev: Combined Review (6229270)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (claude-code/default, done, 3m59s), codex_security (claude-code/security, done, 1m14s) | Total: 5m13s

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (15aaa32)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 4m30s), codex_security (codex/security, done, 29s) | Total: 4m59s

@mariusvniekerk

mariusvniekerk commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

@roborev-ci

roborev-ci Bot commented Jun 21, 2026

Copy link
Copy Markdown

roborev: Combined Review (006d425)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 3m45s), codex_security (codex/security, done, 37s) | Total: 4m22s

@roborev-ci

roborev-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

roborev: Combined Review (b81048c)

Medium issue found: OpenHands provider migration leaves some CLI paths unsupported.

Medium

  • internal/parser/types.go:212 - The OpenHands registry entry removes DiscoverFunc/FindSourceFunc, but parse-diff and session usage/token-use still depend on those legacy hooks to enable OpenHands support. This makes parse-diff --agent openhands unsupported and prevents on-demand syncing an unsynced OpenHands session by ID through usage commands.

    Fix: Update those callers to use provider discovery/source lookup for provider-authoritative file-based agents, or keep compatibility shims until all legacy hook callers are migrated.


Panel: ci_default_security | Synthesis: codex, 7s | Members: codex_default (codex/default, done, 4m15s), codex_security (codex/security, done, 1m13s) | Total: 5m35s

OpenHands stores each conversation as a directory with metadata and event files, so the provider needs a directory source facade rather than a JSONL file wrapper. This keeps the legacy discovery and dashed/undashed ID lookup behavior while making the composite snapshot fingerprint explicit at the provider boundary.

The provider uses the existing OpenHands parser and snapshot helpers so freshness, shallow watch planning, changed-path classification, and normalized parse output stay aligned with the legacy sync path.

test(parser): opt openhands into provider shadow

OpenHands now has a concrete facade provider on this branch, so its migration mode should enter shadow comparison instead of remaining legacy-only and additive.

Earlier provider opt-ins stay inherited and later provider branches own their modes.

Validation: go test -tags "fts5" ./internal/parser -run TestProviderMigrationModes -count=1; go test -tags "fts5" ./internal/parser -count=1; go vet ./...; git diff --check

test(sync): compare openhands shadow parity

OpenHands is shadow-compared on this branch, so add source-level migration coverage that compares provider observation with ParseOpenHandsSession.

The test uses the directory snapshot source shape so the provider fingerprint path and planned data-version behavior stay visible while the branch migrates away from legacy dispatch.

Validation: go test -tags "fts5" ./internal/parser ./internal/sync -run 'TestObserveProviderSourceMatchesOpenHandsLegacyParser|TestOpenHandsProvider|TestParseOpenHands|TestDiscoverAndFindOpenHands|TestClassifyOnePath_OpenHands|TestProcessFileOpenHandsUsesSnapshotMtimeForRetryCache' -count=1; go test -tags "fts5" ./internal/parser ./internal/sync -count=1; go fmt ./...; go vet ./...; git diff --check; ./custom-gcl run --config .golangci.nilaway.yml ./internal/parser/... ./internal/sync/...

refactor(parser): fold openhands into provider

Move OpenHands discovery, source lookup, and parse ownership onto the
concrete provider and delete the package-level DiscoverOpenHandsSessions,
FindOpenHandsSourceFile, and ParseOpenHandsSession free functions.
Discovery now walks conversation roots directly in the provider source
set, raw-session-ID lookup folds the literal/dash-stripped/normalized
matching into sessionDirForID, and parsing runs on a provider receiver
method. The provider-neutral snapshot, session-dir predicate, and event
parse helpers stay as shared free functions.

Make OpenHands provider-authoritative and remove its legacy sync
dispatch: the classifyOnePath block, the processFile case arm, the
OpenHands snapshot-mtime branch, and processOpenHands are gone. Sync now
classifies and processes OpenHands through provider changed-path
handling, which preserves the base_state.json/TASKS.json/events companion
remap to the session directory and keeps the snapshot mtime driving the
skip-retry cache via the provider fingerprint.

Drop the OpenHands AgentDef DiscoverFunc/FindSourceFunc hooks, remove the
shadow baseline test, exempt the provider file from the shim scan, and
add a guard asserting the legacy entrypoints stay deleted.
@roborev-ci

roborev-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (f7a5b0f)

Summary verdict: one medium regression needs to be addressed before merging.

Medium

  • Location: internal/parser/types.go:212, internal/ssh/resolve.go:77, cmd/agentsview/token_use.go:93, cmd/agentsview/token_use.go:113
  • Problem: OpenHands now drops DiscoverFunc/FindSourceFunc, but registry consumers still gate on those hooks. SSH remote sync will skip OpenHands, and unsynced session usage / token-use disk probes will skip OpenHands raw/canonical usage ID resolution.
  • Fix: Make those consumers provider-aware for ProviderMigrationProviderAuthoritative agents, or keep compatibility hooks until they are migrated. Add OpenHands coverage for remote resolve and raw/canonical usage ID resolution.

Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (codex/default, done, 5m27s), codex_security (codex/security, done, 1m59s) | Total: 7m34s

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant