Merged
Conversation
Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn>
Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn>
Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn>
POSIX-specific assertions were baked into six tests, which made the full `pnpm test` suite fail on Windows even though the production code is already cross-platform: - token-store: `0o600` mode bits aren't enforceable on NTFS (reports 0o666); guard the assertion with `process.platform !== 'win32'`. - skills/loader: `new URL(...).pathname` yields `/D:/...` on Windows, so `readdir` sees zero files; use `fileURLToPath()` instead. - opencode-config, locale-ipc, preferences-ipc: replace hard-coded forward-slash path strings with `path.join()`-built expectations that mirror whatever separator the host OS uses. - boot-fallback: `/dev/null/...` is only guaranteed-unwritable on POSIX; build a parent-is-a-regular-file path instead so `mkdirSync` throws ENOTDIR on both platforms. All 10 workspace packages' tests now pass on Windows. Made-with: Cursor Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn>
Made-with: Cursor Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn>
CodeQL flagged the anchored-quantifier pair `/\/+$/` + `/^\/+/` inside `joinEndpoint` (packages/providers/src/images.ts) as a potential ReDoS on library-supplied input. Replace both regex calls with explicit single-pass scans over the trailing/leading `/` characters — same behaviour, trivially linear, no CodeQL alert. Also unblock the Windows test run on this branch: - `token-store.test.ts`: a new 0o600-mode assertion added on main fails on NTFS (always reports 0o666); guard it the same way the existing sibling assertion is guarded. - `safe-read.test.ts`: the symlink-acceptance case requires admin / Developer Mode on Windows and otherwise throws EPERM; skip the case when symlink creation is denied, keeping full coverage on POSIX CI. Signed-off-by: 杨峻骁 <yangjunx21@mails.tsinghua.edu.cn> Made-with: Cursor
Resolve conflict in Settings.tsx: close JSX tags around the new ImageGenerationPanel Save button/wrappers that were dropped during the merge, and drop hardcoded hex fallbacks (#16a34a, #d97706) and text-[10px] in the image-generation status badge in favor of --color-success / --color-warning / text-[var(--text-xs)] tokens. Made-with: Cursor
Contributor
There was a problem hiding this comment.
Findings
- [Major] Enabled image generation silently degrades by disabling the image tool when credentials are missing. This violates the project rule to avoid silent fallbacks and can produce non-image outputs without explicit user-facing failure. Evidence:
apps/desktop/src/main/image-generation-settings.ts:124,apps/desktop/src/main/index.ts:378,apps/desktop/src/main/index.ts:433.
Suggested fix:const cfg = getCachedConfig(); const imageConfig = cfg ? resolveImageGenerationConfig(cfg) : null; if (cfg?.imageGeneration?.enabled === true && imageConfig === null) { throw new CodesignError( 'Image generation is enabled but credentials are missing or invalid. Update Settings > Image Generation.', ERROR_CODES.PROVIDER_AUTH_MISSING, ); }
Summary
- Review mode: initial
- Not found in repo/docs:
docs/VISION.md,docs/PRINCIPLES.md.
Testing
- Not run (automation)
open-codesign Bot
| throw err; | ||
| } | ||
| } | ||
| : undefined; |
Contributor
There was a problem hiding this comment.
[Major] This branch silently disables generate_image_asset when image generation is enabled but credentials are unavailable (resolveImageGenerationConfig returns null). That is a silent fallback rather than a surfaced error.
Suggested fix:
const cfg = getCachedConfig();
const imageConfig = cfg ? resolveImageGenerationConfig(cfg) : null;
if (cfg?.imageGeneration?.enabled === true && imageConfig === null) {
throw new CodesignError(
'Image generation is enabled but credentials are missing or invalid. Update Settings > Image Generation.',
ERROR_CODES.PROVIDER_AUTH_MISSING,
);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets the agent call gpt-image-2 (or OpenRouter image models) on demand to generate bitmap assets (logos, hero images, illustrations) while producing a design, and embeds them seamlessly in preview + exports. Off by default; users opt in from Settings.
Type of change
Linked issue
Checklist
docs/VISION.md,docs/PRINCIPLES.md, andCLAUDE.mdbefore startinggit commit -s)pnpm lint && pnpm typecheck && pnpm testpasses locallypnpm changeset) if user-visibleDependency additions (if any)
Screenshots / recordings (UI changes)