Skip to content

Conversation

@encodedz
Copy link
Collaborator

@encodedz encodedz commented Jan 4, 2026

Main changes

  • Implementing ATP Checkpointer layer for "repair" like LLM tool - LLM's will be able to re-utilize checkpoints from failing runs in order to optimize their next run.
  • Still WIP

const parsed = OperationCheckpointManager.parseCheckpointId(fullCheckpointId);

if (!parsed) {
// If not a full ID format, try loading from current execution (backwards compatibility)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What backward compatibility is needed?

return this.previewObject(result as Record<string, unknown>);
}

if (typeof result === 'string' && result.length > 100) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For string the preview size is hard coded ( and not consistent - in other places its 50 ). Doesn't it make more sense to just use config.previewSize for strings as well?

/**
* Default configuration values
*/
export const DEFAULT_CHECKPOINT_CONFIG: Required<Omit<CheckpointConfig, 'strategy'>> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move from types to consts file

lines.push('In your next code iteration, you can:');
lines.push('1. Directly use data returned from saved checkpoints (full_snapshot)');
lines.push('2. Restore a checkpoint value programmatically using:');
lines.push(' const value = await __restore.checkpoint("<checkpoint_id>");');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe define '__restore' and 'checkpoint' as consts, and reuse them when adding it to the runtime global at packages/server/src/executor/sandbox-injector.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tho its up to the LLM to choose from, ur suggestion always "injecting" them ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ment that '__restore' and 'checkpoint' won't be hardcoded in the prompt, since it will break stuff.
You can do something like

const RESTORE_OPERATION = '__restore';

lines.push(`...${RESTORE_OPERATIPN}`)

and in sandbox-injector.js
	checkpointSetup += `
globalThis.${RESTORE_OPERATION} = {
         ...
	}
};`;


( same for checkpointer )

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.

3 participants