AI

Use Agent from an editor

Supply document context, select a conversation, review prepared prompts, and reuse generated images.

Start with Open Codex chat if you have not used the agent before.

Point an editor request at the right content

An editor's Agent button can attach context from the current frame to your request. Make the intended target clear before opening the popup.

  1. In a text editor, select the passage or code you want to discuss or change.
  2. If nothing is selected, put the cursor near the relevant text and describe the location in your request.
  3. Open Agent and state the desired result and any constraints.
  4. Follow the request in the agent chat and review changes in the document.

Supported editors choose the current selection or a narrower cell or page context when available, falling back to document content. Text-editor requests can include the file path, source-line range, and cursor location; line precision depends on the editor. Selected context guides the request; it does not restrict the agent's project access. Long excerpts may be shortened; the agent is instructed to inspect current live content before editing.

When a terminal frame provides a live session ID, the request identifies that session. The agent can inspect and write to it, so describe whether you want an explanation or a command executed. The terminal's file path alone does not identify the running shell.

Choose where an editor request goes

Before sending a request from an editor's Agent popup, check its destination and submission controls.

  1. Use Recent agent sessions to select the conversation that should receive the request. Continue an existing session when its earlier discussion is relevant.
  2. When offered, choose New agent thread to begin with fresh conversation context. The editor title-bar and kernel-installation popups offer this choice; other helper dialogs may show only recent sessions.
  3. Leave Automatically submit to Agent checked to send the request when you choose Send.
  4. Uncheck it to place the prepared request in the agent chat's composer. Review or extend the message there, then send it from the chat when ready.

The popup remembers recent-session choices for its project, file, and type of request. The automatic-submission preference is stored in the browser and is shared by popups using that control. Check both controls when moving between unrelated tasks. Error-repair dialogs have their own explicit confirmation and may not offer the checkbox.

Inspect a generated agent prompt

Some CoCalc workflows prepare an agent prompt alongside your composer message. When that prompt is present and you have input, the composer shows Agent Prompt.

  1. Click Agent Prompt to open Full agent prompt.
  2. Read the prepared text and edit any task details that need correction.
  3. Choose Copy to copy the draft, Save to keep your changes in the composer, or Cancel to close without applying those edits.
  4. Return to the composer and submit the request when ready.

Saving this dialog updates the prepared prompt; it does not submit a new turn by itself. Use it to review the context supplied for that submission, especially file paths or task-specific instructions generated by the workflow. The button is conditional, so an ordinary chat may not show it. It is an editor for this prepared prompt, not a viewer for every instruction inside the agent runtime or a way to revise an already-running request.

Open and reuse a generated image

When the Codex runtime provides image generation, its result can appear as a Generated image entry in the turn's activity. These controls describe a returned image; they do not mean every model or account has image generation.

  1. Find the Generated image entry for the request.
  2. Read any displayed status and revised prompt to identify the result.
  3. If Open image is available, use it to open the stored image in another browser tab.
  4. Choose Copy beside that link to copy an image reference for reuse in Markdown. Paste it into your intended document or conversation and check the result there.

When an uploaded image link is unavailable but the runtime reports a saved path, the activity entry shows that path instead. Use the path to locate the saved file when accessible. A failed, declined, or cancelled status is not a completed image. If no usable image link or file is available, continue the conversation with the agent rather than assuming the output was saved.