From 9ef1386b0f04786a3209ff35ddc6fad2e90994cb Mon Sep 17 00:00:00 2001 From: jayhack Date: Sun, 15 Jun 2025 18:23:32 -0700 Subject: [PATCH] adds in docs for the image cache --- docs/docs.json | 287 +++++++++++++++-------------- docs/sandboxes/image-snapshots.mdx | 40 ++++ 2 files changed, 184 insertions(+), 143 deletions(-) create mode 100644 docs/sandboxes/image-snapshots.mdx diff --git a/docs/docs.json b/docs/docs.json index 1a5cdf189..72ba796e9 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -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');" + } + ] } diff --git a/docs/sandboxes/image-snapshots.mdx b/docs/sandboxes/image-snapshots.mdx new file mode 100644 index 000000000..75ee0c98e --- /dev/null +++ b/docs/sandboxes/image-snapshots.mdx @@ -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 + + + Invalidating the cache is useful when you've updated your setup commands or + need to ensure agents are working with the latest environment configuration. + + + + Image snapshots significantly reduce the time it takes to start new agent runs + by avoiding the need to repeatedly execute setup commands. +{" "}