Skip to content

fix(gjc): recover conversations from verified managed sessions - #2552

Closed
Haeminway1 wants to merge 1 commit into
devswha:mainfrom
Haeminway1:fix/managed-gjc-20261031
Closed

Haeminway1 wants to merge 1 commit into
devswha:mainfrom
Haeminway1:fix/managed-gjc-20261031

Conversation

@Haeminway1

Copy link
Copy Markdown
Contributor

Summary

Restore conversation resolution for GJC sessions launched through the managed PTY wrapper, without guessing the newest transcript, loosening native transcript roots, or restarting GJC sessions.

  • Add a separate managed-session ownership verification path covering process birth/boot, executable/runtime identity, pane/session generation, transcript identity and final revalidation.
  • Bind SDK responses to endpoint generation and host incarnation; revalidate authorization after asynchronous operations.
  • Integrate managed conversation/tool-output routing with private, no-store responses and regression fixtures.
  • Keep native lifecycle-extension ownership separate.

Verification

Most recent focused run: bun test server/managed-gjc-session.test.ts server/managed-gjc-conversation.test.ts server/gjc-sdk.test.ts server/gjc-sdk-generation.test.ts — 186 passed, 0 failed, run in a separate memory-limited environment.
Earlier work on this same v0.4.21-based repair passed typecheck/build and a broader focused set. The earlier full fast suite was 9351 passed, 36 skipped, 1 failed: server/voice.test.ts:229 expected audio.webm, received clip.webm; the failure also reproduced on clean v0.4.21. It has NOT been suppressed or fixed in this PR.

Draft / limitations

  • Based on v0.4.21 (6c78047). Upstream main has advanced substantially; compatibility with latest main and the full current CI gate still need review.
  • No production deployment, server replacement, or GJC session restart was performed.
  • Production browser rendering with this patch has not been verified.
  • This is independent of the iOS UI-only work; no design reports, unrelated working-tree edits, private conversation data or generated images are included.

Authored with AI assistance.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Heads-up: this repository now asks every contributor to sign a Contributor License Agreement once. You keep the copyright of your work; the CLA gives the maintainer the licence to use it.

To sign, comment on this PR with exactly:

I have read the CLA Document and I hereby sign the CLA

One signature covers this and every later pull request. Nothing else about this PR changes, and a "CLA" check will appear on your next push.

@devswha

devswha commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thanks for this, @Haeminway1, and for writing up the limits so clearly.

We looked at it against the latest release (v0.5.1, which is also current main) before going further. One question decides where this goes next.

The setup it targets. The new path only applies to a GJC started by a managed_pty.py wrapper (serve / attach --record ... --generation ... --terminal ...) running in a herdr-agent-<nonce>.service systemd unit, with its records under ~/dev/agents/herdr_manager/state/managed-sessions (or HERDR_MANAGED_NAMESPACE). Neither Ovis, herdr nor GJC ships that wrapper, and we could not find it published anywhere, so we cannot reproduce the failure here. A GJC started directly in a herdr pane is followed by the native lifecycle path on v0.5.1 (server/gjc-native.ts), and its tests pass on main.

Is that wrapper a public tool we could install and try? If it is your own process manager, the cleaner route is probably for the wrapper to leave the pane in a state Ovis's native path already follows (GJC in the foreground of the pane, or a lifecycle record herdr reports) rather than for Ovis to learn one private layout.

Things we would need settled before a merge either way (from our review at ecaa113):

  • The branch is based on v0.4.21 and conflicts with main in server/conversation.ts and server/pane-routes.ts; main changed that resolver a lot since.
  • Runtime files listed in a record are hashed with a plain readFileSync, so a FIFO or a very large file there blocks the server; they need a non-blocking, regular-file, size-capped open like the record and transcript reads already use.
  • Expanding a managed tool output reads the whole transcript into memory before the 2 MB cap applies.
  • A pane that carries the managed tokens but runs another agent fails before its own resolver runs when the record is missing, and ManagedGjcProofFailure reaches the route as an HTTP 500 instead of the usual "unavailable" fallback.
  • The record names the runtime and CLI that the server then executes, and they are verified before an await, not at the moment they are launched.

No changes were pushed to your branch. It stays open as a draft; let us know about the wrapper and we will take it from there.

@devswha

devswha commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Closing this stale draft PR. As noted in the earlier review, this targets a private herdr_manager / managed_pty.py wrapper layout that does not exist in Ovis, herdr, or GJC, and native GJC sessions are already covered on main (which has also diverged significantly since v0.4.21). Thank you for documenting the approach and limitations so clearly.

@devswha devswha closed this Nov 23, 2026
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.

2 participants