Skip to content

Surface native Codex image views - #277

Closed
hamzamerzic wants to merge 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/codex-image-views
Closed

Surface native Codex image views#277
hamzamerzic wants to merge 1 commit into
mobius-os:mainfrom
hamzamerzic:fix/codex-image-views

Conversation

@hamzamerzic

Copy link
Copy Markdown
Collaborator

Summary

  • import Codex's native ImageViewThreadItem
  • translate image inspection into the shared ViewImage activity used by the transcript
  • pin the SDK contract and start/completion event shape with focused tests

Tests

  • MOBIUS_TEST_RUNTIME=1 pytest -q backend/tests/test_codex_sdk_contract.py backend/tests/test_codex_sdk_runner.py -q

Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
@hamzamerzic hamzamerzic added area: backend Server and API behavior enhancement New feature or request labels Jul 27, 2026
@hamzamerzic

Copy link
Copy Markdown
Collaborator Author

I found a merge-blocking runtime type issue while validating this PR.

ImageViewThreadItem.path is a generated LegacyAppPathString root model, not a plain string. Passing it through as the tool_start.input value makes the streamed activity visible, but every later SQLAlchemy JSON write for that assistant snapshot fails. The reply then disappears when the client reloads authoritative history.

Before merge, the provider adapter should normalize that field into Möbius’s plain-JSON event domain, for example:

"input": _model_dump(getattr(item, "path", "")),

The contract test should instantiate the real generated item rather than a string-valued fake and prove the entire event round-trips through json.dumps:

item = v2_all.ImageViewThreadItem(
  id="image-1", path="/tmp/diagram.png", type="imageView",
)
event = codex_sdk_runner._tool_start_event(item, codex_sdk_runner._sdk_imports())
assert event["input"] == "/tmp/diagram.png"
assert json.loads(json.dumps(event)) == event

I reproduced the failure end to end and verified this conversion against the installed SDK type.

@hamzamerzic

Copy link
Copy Markdown
Collaborator Author

Merged to main as part of #304. Native Codex image views are now included in the integrated default-branch change.

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

Labels

area: backend Server and API behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant