Add durable ima2 image generation and reference editing - #4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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
390px mobile conversation
Hosted CI: pending the PR's
dev-gaterun.Risks and remaining work
gpt-5.6-lunahas real-call qualification; unsupported AGY/MCP lanes cannot execute.dev; merge and deployment require separate owner instruction.