Drawing with the Codex assistant
Implementation notes and historical checks. Open the visual guide →.
Open Assistant in the top toolbar. ReShiki uses the locally installed Codex CLI or desktop app and your existing Codex sign-in. Opening the panel connects in the background. The model chip beside the prompt opens a searchable model menu. Latest available model follows the highest GPT generation advertised by the local catalog (using its preferred model within that generation). An explicit model choice is saved and retained until you change it or return to Latest. If that model becomes unavailable, ReShiki asks you to choose rather than silently substituting another model. If you are signed out, run codex login and reconnect. RESHIKI_CODEX can point to a specific executable.
Describe a molecule, a set of molecules, or a reaction scheme. For example: “Draw the esterification of acetic acid and ethanol. Show ethyl acetate and water, with H₂SO₄ and heat above the arrow.” You can ask follow-up questions to refine the proposal. Ambiguous requests can return a clarification instead of a drawing.
ReShiki validates the proposed SMILES locally and lays out real atoms, bonds, arrows, and captions using the current font, font size, color, bond length, atom-label settings, and JACS/ACS geometry. The result is editable with ordinary tools and supports the same structure and image clipboard formats as other drawings.
Review edits is the initial mode: the preview does not change your drawing. Switch the edit-mode menu beside the prompt to Accept all edits to apply validated proposals directly to the canvas. This choice is saved. Every applied proposal remains one Undo step; invalid proposals and changed replacement targets never bypass validation. A pending valid proposal is also applied when you enable this mode. Apply to drawing adds the proposal below existing content; Replace selected objects targets only the objects selected when you send the request. Reject discards the proposal. Applying creates one history entry: Undo restores the previous drawing and Redo reapplies it. You can keep editing while Codex works. Additive proposals append to the current drawing; Undo removes only that applied proposal. Replacement proposals require the original drawing revision, and switching documents invalidates either kind of proposal. Send a follow-up to regenerate an outdated replacement.
The reasoning chip opens the model’s supported effort levels and service tiers. These choices are saved per model and sent with the next request. New choices default to Low reasoning and Standard service. Explicit effort and tier selections are retained per model. If Low is unavailable, ReShiki uses the model’s advertised reasoning default; unsupported saved levels also fall back safely.
Generation and chemistry validation run asynchronously. Explanations stream into the conversation, elapsed time and the running model remain visible, and the prompt stays editable while waiting. Cmd/Ctrl+Enter sends; plain Enter inserts a line break. Stop cancels generation. New chat clears the conversation and pending proposal. Chats are held in memory for this session; saved drawing files contain only applied objects. When you send, your request, conversation, previous proposal, and selected structures are shared with Codex. With no selection, the current drawing is shared. Generating proposals requires a working Codex connection; ordinary drawing and local chemistry do not.
The assistant can use canvas_inspect to read current object IDs, selection, styles and a rendered canvas image. canvas_preview validates and renders a proposed scheme and returns an image for visual inspection before the final edit. Tools are limited to drawing data; they cannot read unrelated files or control other apps. Images have a fixed pixel budget, and tool work is asynchronous and cancellable. Imported pictures appear in the canvas image; text context includes their IDs, frames and pixel dimensions without duplicating their encoded binary data.
When revising existing content, a proposal can target its atoms, arrows and captions by ID. Review mode shows the replacement preview; Accept all edits applies it directly. Unrelated objects are retained. Invalid IDs, changes outside an explicit replacement selection, changed drawings and switched documents are rejected. Additive proposals do not remove existing content.
Reaction layout uses measured molecular and text bounds, balanced gaps, aligned caption baselines and centered conditions. Participants support explicit coefficients and rotation. Identical disconnected copies are normalized to a single drawn structure with a coefficient; other disconnected components are separated using their visible bounds. Mapped wildcard atoms display as editable R-group labels. Isolated water displays as H₂O. Applying focuses the view on the new scheme.
The integration supports up to 32 molecules and eight reaction steps per proposal, with a maximum of 300 atoms per molecule. Reaction steps support forward, equilibrium and retrosynthesis arrows. Chemical validity checks verify the supplied molecular graphs; review molecular identity, products, stereochemistry and conditions before applying. The assistant does not execute commands or write drawing files directly.
Implementation follows the official Codex app-server protocol, using bounded JSONL messages and structured output. A live integration check generated and rendered an editable esterification proposal. Automated checks cover chemical validation, active drawing styles, editable exchange, cancellation bookkeeping, stale-result protection, Apply/Reject, and Undo/Redo. The assistant has also been used interactively to request, clarify, review, and apply a reaction.
Canvas-assisted scheme verification
Section titled “Canvas-assisted scheme verification”A live run with Latest (GPT-6-Astra), Low reasoning and Standard service inspected a saved canvas image, called the preview tool, and produced a general triglyceride hydrolysis scheme. The result used one water structure with coefficient 3, six editable R-group labels, separated products and centered conditions. Automated tests cover coefficients, disconnected fragments, R-group native exchange, live canvas images, invalid/stale replacement targets and automatic application with Undo/Redo.
Chemical reaction roles
Section titled “Chemical reaction roles”Generated reaction steps retain explicit reactant/product membership and coefficients. Open Properties → Reaction roles… to inspect them, add chemical reagents, and export RXN or reaction SMILES. Applying and undoing an assistant proposal includes this data. See reaction workflow and exchange limits.