Skip to content
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
2 changes: 1 addition & 1 deletion apps/server/src/environmentTheme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ it.layer(NodeServices.layer)("environment theme", (it) => {
return withEnvironmentThemes(
{
...Object.fromEntries(
Array.from({ length: 6 }, (_, index) => [
Array.from({ length: 3 }, (_, index) => [
`aa-${index}.json`,
encodeThemeFileEscaped(large(`Large ${index}`)),
]),
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/environmentTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const MAX_THEME_FILES = 32;
* JSON encoding, at up to 6 bytes per character for a `\uXXXX` escape, plus the colors.
*/
export const MAX_THEME_FILE_BYTES = 6 * THEME_CSS_MAX_LENGTH + 16 * 1024;
const MAX_THEME_TOTAL_BYTES = 6 * MAX_THEME_FILE_BYTES;
// Clients cache every published theme in localStorage, which holds about 5 MB per origin.
const MAX_THEME_TOTAL_BYTES = 2 * 1024 * 1024;

/** A theme's background is `<id>.<extension>` beside `<id>.json`; earlier extensions win. */
const THEME_BACKGROUND_EXTENSIONS = ["webp", "png", "jpg", "jpeg"] as const;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/agentContextBudget.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"claudeSystemAppendBytes": 5930,
"codexAdditionalContextBytes": 7324,
"mcpToolListJsonBytes": 49736
"mcpToolListJsonBytes": 49737
}
2 changes: 1 addition & 1 deletion packages/contracts/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ const EnvironmentThemeColors = Schema.Record(
TrimmedNonEmptyString.check(Schema.isMaxLength(64)),
);

export const THEME_CSS_MAX_LENGTH = 50_000;
export const THEME_CSS_MAX_LENGTH = 100_000;

const environmentThemeFields = {
version: Schema.optional(Schema.Literal(1)),
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/themeCss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const THEME_GUIDE = [
"",
"CSS: `css` applies after the app's styles. Use `.dark` or `:root:not(.dark)` for one appearance.",
"It cannot load files: no @import, no image-set(), and url() only with data: or #id.",
'For a background image, copy a JPEG, PNG, or WebP file of up to 16 MB to `<themesDir>/<themeId>.jpg` (or .png, .webp), beside the theme file. CSS shows it with `var(--theme-background-image)`, such as `[data-workspace-area="conversation"] { background: var(--theme-background-image) center / cover no-repeat; }`. Delete the file to remove it. Do not embed images in `css`: it holds 50,000 characters.',
'For a background image, copy a JPEG, PNG, or WebP file of up to 16 MB to `<themesDir>/<themeId>.jpg` (or .png, .webp), beside the theme file. CSS shows it with `var(--theme-background-image)`, such as `[data-workspace-area="conversation"] { background: var(--theme-background-image) center / cover no-repeat; }`. Delete the file to remove it. Do not embed images in `css`: it holds 100,000 characters.',
"The app's own rules can be more specific. If a rule has no effect, add !important.",
"It cannot reach the terminal text, the file tree, or diff internals. Use color roles for those.",
"Native scrollbars take `::-webkit-scrollbar` and `::-webkit-scrollbar-thumb`.",
Expand Down
Loading