Skip to content

Add durable ima2 image generation and reference editing - #4

Merged
thisisjun786 merged 1 commit into
devfrom
codex/image-engine
Sep 7, 2026
Merged

Add durable ima2 image generation and reference editing#4
thisisjun786 merged 1 commit into
devfrom
codex/image-engine

Conversation

@thisisjun786

Copy link
Copy Markdown
Owner

Change

Lina can now create one image through ima2, show the saved result in the originating conversation, and edit that image using its original managed bytes as a reference. The integration adds connection/model discovery and six image tools to the existing Codex host, with no new package dependency.

Image execution has session-bound durable state. Submission uncertainty, cancellation intent, result import and completion delivery survive restart without blindly repeating a generation. Stable attachment IDs and the existing Codex notice journal prevent duplicate files and messages. Existing conversation Markdown renders only managed image previews belonging to that session.

UI redesign and world logic remain outside this change. The adapter targets ima2-gen 3.14.0; setup, contracts and acceptance evidence are recorded in the image-engine plan.

Verification

Local checks on the submitted source:

  • bun test: 1,429 passed, 0 failed; 6,485 assertions across 196 files.
  • bun run typecheck, bun run lint, bun run ci:validate, bun run ci:build: passed. Lint retains five existing warnings.
  • bun scripts/ci/audit.ts: lockfile and installed dependencies passed.
  • bash scripts/ci/secrets.sh: seven commits scanned; no findings.
  • git diff --check: passed. Independent code review passed after regression fixes for notice failure, oversized output, cancellation persistence and result filenames.
  • Local fixtures cover failure, unavailable/authentication/model errors, uncertain submission, cancellation races, attachment ownership, import replay, deferred delivery and restart recovery.

Separately authorized real calls: one creation and one reference edit succeeded through ima2 OAuth / gpt-5.6-luna, each reported as 29.9 seconds. The edit changed a robot's orange hat to purple; the original attachment hash remained unchanged. Both results appeared in the same test conversation. Restart restored both images and exactly two completion notices with no additional generation; an expired terminal record was recovered through request-filtered history.

The image provider calls were real; conversation RPC used a deterministic test driver. This does not qualify autonomous tool selection by a live conversation model. Failure/cancellation negatives used local fixtures, without additional paid calls. Browser checks covered reload and a 390px viewport; the isolated harness stubs the unrelated task sidebar empty.

The screenshots below show the synthetic blue/green fixture flow, not the real provider outputs. Source/input provenance is documented in the plan.

Desktop conversation: generated image and reference edit

Synthetic image generation and edit in the existing desktop conversation

390px mobile conversation

Synthetic edited image in the mobile conversation

Hosted CI: pending the PR's dev-gate run.

Risks and remaining work

  • Compatibility is pinned to ima2 3.14.0. Only OAuth / gpt-5.6-luna has real-call qualification; unsupported AGY/MCP lanes cannot execute.
  • This slice supports one PNG/JPEG up to 2 MiB and reference editing. Masks, video, batches and Studio workflows are outside scope.
  • Remote bearer/cookie/LAN-token authentication is not supported. ima2 remains separately managed.
  • A permanently uncertain job requires upstream investigation and blocks new generation in that conversation; there is no force-retry bypass. A cancellation acknowledgement alone does not prove the provider stopped or refunded a request.
  • Production Lina deployment and automatic ima2 startup have not been configured. This PR targets dev; merge and deployment require separate owner instruction.

Connect ima2 through Lina-owned image tools and reuse managed attachments and Codex notices so results survive retries and restarts. Include failure and cancellation coverage, browser evidence, and the separately authorized OAuth qualification.
@thisisjun786
thisisjun786 merged commit cd74c89 into dev Sep 7, 2026
7 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.

1 participant