Skip to content

fix(agent): create fresh OMP sessions without resume (ZIC-310) - #9131

Merged
Bohan-J merged 1 commit into
multica-ai:mainfrom
vicksiyi:multica-fix/issue-9124-omp-fresh-session
Oct 9, 2026
Merged

Bohan-J merged 1 commit into
multica-ai:mainfrom
vicksiyi:multica-fix/issue-9124-omp-fresh-session

Conversation

@vicksiyi

@vicksiyi vicksiyi commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix fresh Oh-My-Pi chat and quick-create runs failing immediately on OMP 18.8.3. The shared Pi adapter pre-created an empty JSONL and passed it as --session; OMP treats that flag as strict resume and refuses the file before processing the prompt.

Fresh OMP runs now use --session-dir with a private directory under Multica's session store. After the process exits, the adapter returns the persisted JSONL path for the next turn. Existing OMP sessions retain explicit path-based resume and locking; Pi retains its existing startup behavior.

Related Issue

Closes #9124

Multica: ZIC-310

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Refactor / code improvement (no behavior change)
  • Documentation update
  • Tests (adding or improving test coverage)
  • CI / infrastructure

Changes Made

  • Separate OMP fresh-session creation from Pi/resume setup in server/pkg/agent/pi.go.
  • Add OMP-specific session argument filtering and persisted-transcript discovery in omp_session.go. Custom arguments cannot redirect session selection or disable persistence.
  • Cover fresh chat/task prompts, subsequent history, empty/missing resumes, missing/ambiguous persisted transcripts, and argument ownership. Update existing OMP fixtures to provide actual resume files.
  • Add an opt-in real OMP startup test that uses isolated configuration and no prompt, so it makes no model call.

The transcript remains beside OMP's companion artifacts. A completed process without exactly one nonempty root JSONL is reported as failed instead of publishing a fabricated resume path. This assumes OMP's documented session-directory layout; multiple root transcripts fail explicitly rather than selecting arbitrary history. No schema, API, or Pi behavior changes.

How to Test

  1. cd server && go test ./pkg/agent -count=1 — passed.
  2. go test -race ./pkg/agent -run 'Test(OmpFreshSession|BuildOmpArgsOwnsSessionSelection|FindOmpSessionFile)' -count=1 — passed.
  3. go test ./internal/daemon -run 'Test.*(PiSession|Omp|Resume)' -count=1 — passed.
  4. The fresh-session regression fails on the original adapter with omp exited with error: exit status 1 and passes with this fix.
  5. MULTICA_RUN_REAL_AGENT_SMOKE=1 MULTICA_OMP_SMOKE_EXECUTABLE=/path/to/omp go test -tags=agentintegration ./pkg/agent -run '^TestOmpSessionStartupWithoutModelCall$' -count=1 -v — passed against the SHA-256-verified OMP 18.8.3 macOS ARM64 release: empty resume rejected; fresh startup and valid-header resume succeeded. Uses an isolated home/config, empty stdin, and no model request. Persistence across actual prompt turns is covered by the fake-runtime regression above; no paid/live model turn was run.

make worktree-env succeeded. make check-worktree stopped at PostgreSQL setup because Docker is unavailable. The script's exit trap printed a misleading success message/exit code; the full pipeline did not run. Focused Go checks above used Go 1.26.6.

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots
  • I have updated relevant documentation to reflect my changes
  • If I added a new runtime / coding tool / UI tab, I synced the change to landing copy (apps/web/features/landing/i18n/) and relevant docs (apps/docs/content/docs/)
  • If this PR touches Chinese product copy, I checked it against apps/docs/content/docs/developers/conventions.zh.mdx (terminology, mixed-rule for task / issue / skill)
  • I have considered and documented any risks above
  • I will address all reviewer comments before requesting merge

UI, copy, and new-runtime documentation items do not apply.

AI Disclosure

AI tool used: Codex through Multica.

Prompt / approach: Investigate #9124, trace OMP 18.8.3's session creation/resume contract, reproduce the original adapter failure, preserve subsequent turns, and add focused regression coverage without making a model request.

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

@vicksiyi is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@Bohan-J Bohan-J left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clear reproduction and focused fix! Separating fresh OMP session creation from explicit resume preserves existing session paths and locking while keeping Pi's startup behavior unchanged.

I reran the agent package tests, daemon resume-related tests, and the real OMP startup smoke test on 18.8.5. Additional startup checks passed on 17.2.12 and 18.8.5, including loading a session header emitted by the older version in the newer one. These CLI checks did not make model calls; the two-turn persistence regression uses a simulated runtime. Approved.

@Bohan-J
Bohan-J merged commit 00e24a8 into multica-ai:main Oct 9, 2026
16 checks passed
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.

[Bug]: Oh-My-Pi 18.8.3 fails on fresh runs because the daemon passes an empty file to --session

2 participants