Skip to content

docs: Adds in docs for the image cache #1137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 144 additions & 143 deletions docs/docs.json
Original file line number Diff line number Diff line change
@@ -1,145 +1,146 @@
{
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "Codegen",
"colors": {
"primary": "#a277ff",
"light": "#a277ff",
"dark": "#a277ff"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Overview",
"pages": [
"introduction/overview",
"introduction/api",
"introduction/prompting",
"introduction/community",
"introduction/about",
"introduction/faq"
]
},
{
"group": "Capabilities",
"pages": ["capabilities/capabilities", "capabilities/wake-up"]
},
{
"group": "Integrations",
"pages": [
"integrations/github",
"integrations/slack",
"integrations/linear",
"integrations/jira",
"integrations/notion",
"integrations/figma",
"integrations/circleci",
"integrations/web-search",
"integrations/postgres"
]
},
{
"group": "Sandboxes",
"pages": [
"sandboxes/overview",
"sandboxes/setup-commands",
"sandboxes/environment-variables",
"sandboxes/secrets",
"sandboxes/editor",
"sandboxes/web-preview"
]
},
{
"group": "Settings",
"pages": ["settings/repo-rules", "settings/model-configuration"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "Endpoints",
"openapi": {
"source": "/api-reference/openapi3.json",
"directory": "api-reference"
}
},
{
"group": "Guides",
"pages": ["api-reference/agent-run-logs"]
}
]
},
{
"tab": "Blog",
"groups": [
{
"group": "Blog",
"pages": ["blog/posts", "blog/devin", "blog/act-via-code"]
}
]
},
{
"tab": "Changelog",
"groups": [
{
"group": "Changelog",
"pages": ["changelog/changelog"]
}
]
}
]
},
"logo": {
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
},
"appearance": {
"default": "dark"
},
"background": {
"decoration": "gradient"
},
"navbar": {
"primary": {
"type": "button",
"label": "GitHub",
"href": "https://github.com/codegen-sh/codegen-sdk"
}
},
"seo": {
"metatags": {
"og:site_name": "Codegen",
"og:title": "Codegen - The SWE that Never Sleeps",
"og:description": "Code agents accessible via API, Slack, Linear, Github, and more.",
"og:url": "https://docs.codegen.com",
"og:locale": "en_US",
"og:logo": "https://i.imgur.com/f4OVOqI.png",
"article:publisher": "Codegen, Inc.",
"twitter:site": "@codegen"
},
"indexing": "navigable"
},
"footer": {
"socials": {
"x": "https://x.com/codegen",
"linkedin": "https://linkedin.com/company/codegen-dot-com"
}
},
"integrations": {
"posthog": {
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
}
},
"head": [
{
"tag": "script",
"content": "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-T7G5S78D');"
}
]
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "Codegen",
"colors": {
"primary": "#a277ff",
"light": "#a277ff",
"dark": "#a277ff"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Overview",
"pages": [
"introduction/overview",
"introduction/api",
"introduction/prompting",
"introduction/community",
"introduction/about",
"introduction/faq"
]
},
{
"group": "Capabilities",
"pages": ["capabilities/capabilities", "capabilities/wake-up"]
},
{
"group": "Integrations",
"pages": [
"integrations/github",
"integrations/slack",
"integrations/linear",
"integrations/jira",
"integrations/notion",
"integrations/figma",
"integrations/circleci",
"integrations/web-search",
"integrations/postgres"
]
},
{
"group": "Sandboxes",
"pages": [
"sandboxes/overview",
"sandboxes/setup-commands",
"sandboxes/image-snapshots",
"sandboxes/environment-variables",
"sandboxes/secrets",
"sandboxes/editor",
"sandboxes/web-preview"
]
},
{
"group": "Settings",
"pages": ["settings/repo-rules", "settings/model-configuration"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "Endpoints",
"openapi": {
"source": "/api-reference/openapi3.json",
"directory": "api-reference"
}
},
{
"group": "Guides",
"pages": ["api-reference/agent-run-logs"]
}
]
},
{
"tab": "Blog",
"groups": [
{
"group": "Blog",
"pages": ["blog/posts", "blog/devin", "blog/act-via-code"]
}
]
},
{
"tab": "Changelog",
"groups": [
{
"group": "Changelog",
"pages": ["changelog/changelog"]
}
]
}
]
},
"logo": {
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
},
"appearance": {
"default": "dark"
},
"background": {
"decoration": "gradient"
},
"navbar": {
"primary": {
"type": "button",
"label": "GitHub",
"href": "https://github.com/codegen-sh/codegen-sdk"
}
},
"seo": {
"metatags": {
"og:site_name": "Codegen",
"og:title": "Codegen - The SWE that Never Sleeps",
"og:description": "Code agents accessible via API, Slack, Linear, Github, and more.",
"og:url": "https://docs.codegen.com",
"og:locale": "en_US",
"og:logo": "https://i.imgur.com/f4OVOqI.png",
"article:publisher": "Codegen, Inc.",
"twitter:site": "@codegen"
},
"indexing": "navigable"
},
"footer": {
"socials": {
"x": "https://x.com/codegen",
"linkedin": "https://linkedin.com/company/codegen-dot-com"
}
},
"integrations": {
"posthog": {
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
}
},
"head": [
{
"tag": "script",
"content": "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-T7G5S78D');"
}
]
}
40 changes: 40 additions & 0 deletions docs/sandboxes/image-snapshots.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Image Snapshots"
sidebarTitle: "Image Snapshots"
icon: "camera"
---

Codegen automatically creates filesystem snapshots of your sandbox environment to enable faster initialization of new agent runs. These snapshots capture the state of your environment after setup commands have been executed.

## How It Works

After your [setup commands](/sandboxes/setup-commands) run successfully, Codegen takes a snapshot of the entire filesystem. This snapshot serves as a cached starting point for future agent interactions, eliminating the need to re-run setup commands each time.

**Lazy Population**: Image caches are populated automatically and lazily. If no cache exists or the cache has expired, Codegen will create a new snapshot during the next agent run. This means the first agent run (or runs after cache expiration) may be slower as they need to execute setup commands and create the snapshot.

## Cache TTL

By default, image snapshots are cached for **24 hours**. After this period expires, Codegen will automatically create a fresh snapshot the next time an agent runs against your repository.

## Managing Image Cache

You can manage your repository's image cache settings by navigating to:

```
https://codegen.com/repos/{repoName}/image-cache
```

From this page, you can:

- **Invalidate the current cache** - Force creation of a new snapshot on the next agent run
- **Set a custom TTL** - Adjust how long snapshots are cached before expiring

<Tip>
Invalidating the cache is useful when you've updated your setup commands or
need to ensure agents are working with the latest environment configuration.
</Tip>

<Note>
Image snapshots significantly reduce the time it takes to start new agent runs
by avoiding the need to repeatedly execute setup commands.
</Note>{" "}
Loading