Split a Large GPT-6 Astra Code Deliverable at File Boundaries

When a CometAPI Astra task may exceed one response, divide it at file boundaries, not at arbitrary text chunks. That is the safest continuation unit because the source set says Astra is intended for difficult end-to-end work that reasons, uses tools, interacts with software, revises intermediate work, and carries a task to a finished result (sources/src-adf31111749c7b6d1c6acbfe1d79296d.json). The same source also says Astra can keep notes across context windows, which makes file-level continuity more useful than paragraph-level slicing during a long coding run (sources/src-adf31111749c7b6d1c6acbfe1d79296d.json).

A practical split policy for a CometAPI integration is simple:

  1. Finish one file completely.
  2. Mark that file complete in a manifest.
  3. Move to the next file.
  4. If a file is too large for one response, interrupt only inside that file and resume from the stored checkpoint.

That policy keeps the caller’s artifact list stable across requests. It also matches OpenAI’s official model guidance for GPT-6 Astra: the model page lists a 1.05M-token context window, 128K maximum output, and reasoning effort levels from low through max (sources/src-cd52887026c57c5dab417815900b6ce1.json). The guidance page recommends selecting the lowest reasoning effort that meets the eval target, because token efficiency often matters more than always running at maximum reasoning (sources/src-5b9f7f352beb2cc7d4d21b3e45b15aa1.json).

Useful file manifest shape:

  • file_path: exact path of the file being produced.
  • completion_state: pending, in_progress, complete, or blocked.
  • last_checkpoint: last verified section, function, or test block.
  • next_action: the next edit or validation step.

These fields make continuation explicit. They let a caller ask, “What remains?” without re-reading the whole prompt or guessing where a partial response stopped. They also support a clean recovery boundary: completed files stay complete unless their content changes, while interrupted work resumes from the last checkpoint inside the same file.

Illustrative completion states:

  • pending means the file has not started.
  • in_progress means the file is underway and has a checkpoint.
  • complete means the file is finished and validated.
  • blocked means the file cannot finish until a dependency changes.

Untested gateway support: the CometAPI article says the Responses API is the natural starting point for tool-heavy workflows and lists function calling, structured outputs, web search, file search, code interpreter, hosted shell, apply patch, computer use, MCP, and tool search (sources/src-adf31111749c7b6d1c6acbfe1d79296d.json). That does not prove any specific live gateway behavior in this workspace, but it does support a file-oriented continuation design because tool-heavy work can span multiple steps.

Illustrative interrupted-file recovery example:

  • A run completes src/client.ts and src/manifest.ts.
  • The run stops while editing src/retry.ts.
  • On resume, load the manifest.
  • Verify the first two files are still complete.
  • Continue only with src/retry.ts from the stored checkpoint.

Do not reopen the completed files unless their own content changed and the manifest marks them for rework. That keeps the continuation boundary aligned with the artifact boundary, which is more reliable than cutting a response in the middle of a thought or across unrelated text.

For this topic, the decision is therefore not “How do we split text?” but “How do we preserve work state?” The answer is: use a file manifest, record completion states, and treat each file as the unit of continuation. That is the cleanest way to preserve the caller’s artifact manifest across CometAPI Astra requests and to validate each finished file before moving on.

A manifest can still be wrong after a crash even when every response stops at a file boundary. Consider the failure between saving src/client.ts and recording it as complete: the next request might regenerate a file whose new bytes are already present.

I would add an application-owned checkpoint receipt for each accepted file:

path: src/client.ts
prior_content_digest: digest of the version before this step
accepted_content_digest: digest of the complete staged file
validation: passed checks bound to accepted_content_digest

The digests here are placeholders for values computed from actual bytes, not model-supplied assurances. An illustrative recovery rule is:

File state after restart Next action
Matches the accepted digest and its validation receipt Reconcile the manifest to complete; do not regenerate.
Matches the prior digest The installation has not been observed; retain pending state and inspect the staged artifact.
Matches neither digest Stop this file and preserve it for conflict resolution.

Keep the staged file until installation and its checkpoint are durably recorded. If the process died before writing a validation receipt, run the required checks again against the exact observed bytes rather than inferring success from the file’s existence.

There is also a dependency boundary: a completed file may need revalidation when an imported interface changes even if that file’s own bytes do not. Record the relevant dependency revision with the check result. This makes “complete” a statement about a file and its tested inputs, not just a remembered label. These are proposed recovery rules for the caller’s workspace; they do not assume any particular CometAPI continuation or filesystem feature.

One clarification on the effort advice: OpenAI’s latest-model guidance does not prescribe a universal lowest setting; it preserves the current effective effort except when moving from none/minimal, where it says to start low and compare. A minimum-passing effort ladder is an evaluation recommendation, not that upstream rule. The CometAPI Astra article supplies product context, rather than evidence that a particular setting passes your task.