Skip to content

Commit 155e4b6

Browse files
authored
docs: Adds in docs for the image cache (#1137)
1 parent d8f2f30 commit 155e4b6

File tree

2 files changed

+184
-143
lines changed

2 files changed

+184
-143
lines changed

docs/docs.json

Lines changed: 144 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,146 @@
11
{
2-
"$schema": "https://mintlify.com/docs.json",
3-
"theme": "maple",
4-
"name": "Codegen",
5-
"colors": {
6-
"primary": "#a277ff",
7-
"light": "#a277ff",
8-
"dark": "#a277ff"
9-
},
10-
"favicon": "/favicon.svg",
11-
"navigation": {
12-
"tabs": [
13-
{
14-
"tab": "Documentation",
15-
"groups": [
16-
{
17-
"group": "Overview",
18-
"pages": [
19-
"introduction/overview",
20-
"introduction/api",
21-
"introduction/prompting",
22-
"introduction/community",
23-
"introduction/about",
24-
"introduction/faq"
25-
]
26-
},
27-
{
28-
"group": "Capabilities",
29-
"pages": ["capabilities/capabilities", "capabilities/wake-up"]
30-
},
31-
{
32-
"group": "Integrations",
33-
"pages": [
34-
"integrations/github",
35-
"integrations/slack",
36-
"integrations/linear",
37-
"integrations/jira",
38-
"integrations/notion",
39-
"integrations/figma",
40-
"integrations/circleci",
41-
"integrations/web-search",
42-
"integrations/postgres"
43-
]
44-
},
45-
{
46-
"group": "Sandboxes",
47-
"pages": [
48-
"sandboxes/overview",
49-
"sandboxes/setup-commands",
50-
"sandboxes/environment-variables",
51-
"sandboxes/secrets",
52-
"sandboxes/editor",
53-
"sandboxes/web-preview"
54-
]
55-
},
56-
{
57-
"group": "Settings",
58-
"pages": ["settings/repo-rules", "settings/model-configuration"]
59-
}
60-
]
61-
},
62-
{
63-
"tab": "API Reference",
64-
"groups": [
65-
{
66-
"group": "Endpoints",
67-
"openapi": {
68-
"source": "/api-reference/openapi3.json",
69-
"directory": "api-reference"
70-
}
71-
},
72-
{
73-
"group": "Guides",
74-
"pages": ["api-reference/agent-run-logs"]
75-
}
76-
]
77-
},
78-
{
79-
"tab": "Blog",
80-
"groups": [
81-
{
82-
"group": "Blog",
83-
"pages": ["blog/posts", "blog/devin", "blog/act-via-code"]
84-
}
85-
]
86-
},
87-
{
88-
"tab": "Changelog",
89-
"groups": [
90-
{
91-
"group": "Changelog",
92-
"pages": ["changelog/changelog"]
93-
}
94-
]
95-
}
96-
]
97-
},
98-
"logo": {
99-
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
100-
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
101-
},
102-
"appearance": {
103-
"default": "dark"
104-
},
105-
"background": {
106-
"decoration": "gradient"
107-
},
108-
"navbar": {
109-
"primary": {
110-
"type": "button",
111-
"label": "GitHub",
112-
"href": "https://github.com/codegen-sh/codegen-sdk"
113-
}
114-
},
115-
"seo": {
116-
"metatags": {
117-
"og:site_name": "Codegen",
118-
"og:title": "Codegen - The SWE that Never Sleeps",
119-
"og:description": "Code agents accessible via API, Slack, Linear, Github, and more.",
120-
"og:url": "https://docs.codegen.com",
121-
"og:locale": "en_US",
122-
"og:logo": "https://i.imgur.com/f4OVOqI.png",
123-
"article:publisher": "Codegen, Inc.",
124-
"twitter:site": "@codegen"
125-
},
126-
"indexing": "navigable"
127-
},
128-
"footer": {
129-
"socials": {
130-
"x": "https://x.com/codegen",
131-
"linkedin": "https://linkedin.com/company/codegen-dot-com"
132-
}
133-
},
134-
"integrations": {
135-
"posthog": {
136-
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
137-
}
138-
},
139-
"head": [
140-
{
141-
"tag": "script",
142-
"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');"
143-
}
144-
]
2+
"$schema": "https://mintlify.com/docs.json",
3+
"theme": "maple",
4+
"name": "Codegen",
5+
"colors": {
6+
"primary": "#a277ff",
7+
"light": "#a277ff",
8+
"dark": "#a277ff"
9+
},
10+
"favicon": "/favicon.svg",
11+
"navigation": {
12+
"tabs": [
13+
{
14+
"tab": "Documentation",
15+
"groups": [
16+
{
17+
"group": "Overview",
18+
"pages": [
19+
"introduction/overview",
20+
"introduction/api",
21+
"introduction/prompting",
22+
"introduction/community",
23+
"introduction/about",
24+
"introduction/faq"
25+
]
26+
},
27+
{
28+
"group": "Capabilities",
29+
"pages": ["capabilities/capabilities", "capabilities/wake-up"]
30+
},
31+
{
32+
"group": "Integrations",
33+
"pages": [
34+
"integrations/github",
35+
"integrations/slack",
36+
"integrations/linear",
37+
"integrations/jira",
38+
"integrations/notion",
39+
"integrations/figma",
40+
"integrations/circleci",
41+
"integrations/web-search",
42+
"integrations/postgres"
43+
]
44+
},
45+
{
46+
"group": "Sandboxes",
47+
"pages": [
48+
"sandboxes/overview",
49+
"sandboxes/setup-commands",
50+
"sandboxes/image-snapshots",
51+
"sandboxes/environment-variables",
52+
"sandboxes/secrets",
53+
"sandboxes/editor",
54+
"sandboxes/web-preview"
55+
]
56+
},
57+
{
58+
"group": "Settings",
59+
"pages": ["settings/repo-rules", "settings/model-configuration"]
60+
}
61+
]
62+
},
63+
{
64+
"tab": "API Reference",
65+
"groups": [
66+
{
67+
"group": "Endpoints",
68+
"openapi": {
69+
"source": "/api-reference/openapi3.json",
70+
"directory": "api-reference"
71+
}
72+
},
73+
{
74+
"group": "Guides",
75+
"pages": ["api-reference/agent-run-logs"]
76+
}
77+
]
78+
},
79+
{
80+
"tab": "Blog",
81+
"groups": [
82+
{
83+
"group": "Blog",
84+
"pages": ["blog/posts", "blog/devin", "blog/act-via-code"]
85+
}
86+
]
87+
},
88+
{
89+
"tab": "Changelog",
90+
"groups": [
91+
{
92+
"group": "Changelog",
93+
"pages": ["changelog/changelog"]
94+
}
95+
]
96+
}
97+
]
98+
},
99+
"logo": {
100+
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
101+
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
102+
},
103+
"appearance": {
104+
"default": "dark"
105+
},
106+
"background": {
107+
"decoration": "gradient"
108+
},
109+
"navbar": {
110+
"primary": {
111+
"type": "button",
112+
"label": "GitHub",
113+
"href": "https://github.com/codegen-sh/codegen-sdk"
114+
}
115+
},
116+
"seo": {
117+
"metatags": {
118+
"og:site_name": "Codegen",
119+
"og:title": "Codegen - The SWE that Never Sleeps",
120+
"og:description": "Code agents accessible via API, Slack, Linear, Github, and more.",
121+
"og:url": "https://docs.codegen.com",
122+
"og:locale": "en_US",
123+
"og:logo": "https://i.imgur.com/f4OVOqI.png",
124+
"article:publisher": "Codegen, Inc.",
125+
"twitter:site": "@codegen"
126+
},
127+
"indexing": "navigable"
128+
},
129+
"footer": {
130+
"socials": {
131+
"x": "https://x.com/codegen",
132+
"linkedin": "https://linkedin.com/company/codegen-dot-com"
133+
}
134+
},
135+
"integrations": {
136+
"posthog": {
137+
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
138+
}
139+
},
140+
"head": [
141+
{
142+
"tag": "script",
143+
"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');"
144+
}
145+
]
145146
}

docs/sandboxes/image-snapshots.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Image Snapshots"
3+
sidebarTitle: "Image Snapshots"
4+
icon: "camera"
5+
---
6+
7+
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.
8+
9+
## How It Works
10+
11+
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.
12+
13+
**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.
14+
15+
## Cache TTL
16+
17+
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.
18+
19+
## Managing Image Cache
20+
21+
You can manage your repository's image cache settings by navigating to:
22+
23+
```
24+
https://codegen.com/repos/{repoName}/image-cache
25+
```
26+
27+
From this page, you can:
28+
29+
- **Invalidate the current cache** - Force creation of a new snapshot on the next agent run
30+
- **Set a custom TTL** - Adjust how long snapshots are cached before expiring
31+
32+
<Tip>
33+
Invalidating the cache is useful when you've updated your setup commands or
34+
need to ensure agents are working with the latest environment configuration.
35+
</Tip>
36+
37+
<Note>
38+
Image snapshots significantly reduce the time it takes to start new agent runs
39+
by avoiding the need to repeatedly execute setup commands.
40+
</Note>{" "}

0 commit comments

Comments
 (0)