Skip to content

Pr/resilience model cooldown - [deferred to v4.0.0-rc1]#2143

Open
rafacpti23 wants to merge 27 commits into
diegosouzapw:release/v3.8.0from
rafacpti23:pr/resilience-model-cooldown
Open

Pr/resilience model cooldown - [deferred to v4.0.0-rc1]#2143
rafacpti23 wants to merge 27 commits into
diegosouzapw:release/v3.8.0from
rafacpti23:pr/resilience-model-cooldown

Conversation

@rafacpti23
Copy link
Copy Markdown
Contributor

@rafacpti23 rafacpti23 commented May 11, 2026

Summary

  • Describe the user-facing or operational change.

Related Issues

  • Closes #
  • Related to #

Validation

  • npm run lint
  • npm run test:unit
  • npm run test:coverage
  • Coverage is still >= 60% for statements, lines, functions, and branches
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below

Tests Added Or Updated

  • List every changed or added automated test file.
  • If no production code changed, state that here.

Coverage Notes

  • If this PR changes src/, open-sse/, electron/, or bin/, explain which tests cover the change.
  • If coverage moved down in any touched file, explain why and what follow-up task will recover it.

Reviewer Notes

  • Call out any risky areas, migrations, feature flags, or manual validation that reviewers should know about.

Deferred to v4.0.0-rc1 — This PR will be integrated in the v4.0.0 release cycle due to its scope and architectural impact.

rafacpti23 and others added 27 commits April 20, 2026 15:20
@rafacpti23 rafacpti23 requested a review from diegosouzapw as a code owner May 11, 2026 04:08
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a comprehensive SaaS layer branded as 'Easy IA,' which includes a new landing page, a customer portal, and administrative interfaces for managing users, subscription plans, and billing integrated with Mercado Pago. Key technical enhancements include the addition of Qdrant for semantic memory indexing, a refactored proxy middleware with improved authentication and body size guards, and new resilience features such as model cooldown management. Reviewers identified critical security risks regarding hardcoded placeholders for sensitive credentials in the production stack configuration and the removal of logic for immediate runtime setting application. Further feedback points to a regression in internationalization within the memory management UI and suggests verifying that the updated proxy matcher correctly handles all existing API endpoints.

Comment thread docker-stack.prod.yml
Comment on lines +28 to +29
MANAGEMENT_PASSWORD: TROQUE_ESTA_SENHA_ADMIN_FORTE
STORAGE_ENCRYPTION_KEY: TROQUE_ESTA_CHAVE_COM_32_CARACTERES_OU_MAIS
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The MANAGEMENT_PASSWORD and STORAGE_ENCRYPTION_KEY are defined with placeholder values (TROQUE_ESTA_SENHA_ADMIN_FORTE, TROQUE_ESTA_CHAVE_COM_32_CARACTERES_OU_MAIS). While these are intended as reminders, hardcoding sensitive information, even as placeholders, can lead to insecure deployments if not properly updated. For production environments, it is highly recommended to manage these values using Docker secrets or external environment variables that are not committed to version control.

Comment thread src/lib/db/settings.ts
Comment on lines 109 to -116
invalidateDbCache("settings"); // Bust the read cache immediately
const nextSettings = await getSettings();

try {
const { applyRuntimeSettings } = await import("@/lib/config/runtimeSettings");
await applyRuntimeSettings(nextSettings, { source: "settings:update" });
} catch (error) {
console.warn(
"[HOT_RELOAD] Failed to apply runtime settings after update:",
error instanceof Error ? error.message : error
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The logic to apply runtime settings after updating them has been removed. If certain settings require immediate application without a server restart, this change might prevent them from taking effect or introduce unexpected delays. Please clarify if this is intentional and if there's an alternative mechanism to ensure critical runtime settings are applied promptly.

Comment on lines 488 to +489
<div className="text-sm text-gray-500">
{t("pageInfo", { page, totalPages, total })}
Page {page} of {totalPages} ({total} total)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The text "Page {page} of {totalPages} ({total} total)" is hardcoded in English, removing the internationalization support previously provided by t("pageInfo"). To maintain consistency with other translated elements on the page, please use an i18n key for this string.

Suggested change
<div className="text-sm text-gray-500">
{t("pageInfo", { page, totalPages, total })}
Page {page} of {totalPages} ({total} total)
<div className="text-sm text-gray-500">
{t("pageInfo", { page, totalPages, total })}
</div>

Comment thread src/proxy.ts
Comment on lines 193 to +194
export const config = {
matcher: [
"/",
"/dashboard/:path*",
"/api/:path*",
"/v1/:path*",
"/v1",
"/chat/:path*",
"/responses/:path*",
"/responses",
"/codex/:path*",
"/codex",
"/models",
],
matcher: ["/", "/adm/:path*", "/dashboard/:path*", "/api/:path*"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The config.matcher has been updated to include /adm/:path* and remove specific /v1/ and /chat/ routes. While /api/:path* covers most API routes, ensure that all previously matched /v1/ and /chat/ routes are correctly handled by the new /api/:path* pattern or explicitly added if they fall outside its scope. This is important to prevent unintended routing issues for existing API endpoints.

@diegosouzapw diegosouzapw changed the base branch from main to release/v3.8.0 May 11, 2026 12:58
@diegosouzapw
Copy link
Copy Markdown
Owner

Hey @rafacpti23, thanks for this contribution! 🚀

We really appreciate the work you've put into these features — the SaaS module, Qdrant integration, model cooldowns, and resilience improvements are all excellent additions.

However, given the scope of the changes (~28K+ lines, 100 files), this PR is better suited for the next major release cycle. We don't want to rush such a large feature set into v3.8.0 where it could introduce regressions.

Plan: This PR will be deferred to v4.0.0-rc1, where we'll have a dedicated integration window for these features. We'll keep this PR open and track it for the v4.0.0 milestone.

In the meantime, the model cooldown feature (PR #2146) has been extracted as a focused PR and will be integrated into v3.8.0 separately.

Thanks again for the amazing work! 🙌

@diegosouzapw diegosouzapw changed the title Pr/resilience model cooldown Pr/resilience model cooldown - [deferred to v4.0.0-rc1] May 11, 2026
@diegosouzapw
Copy link
Copy Markdown
Owner

Thank you for this contribution! After review, this PR has been deferred to the v4.0.0-rc1 milestone as it introduces architectural changes that are better suited for the next major release. We'll revisit it there. We appreciate your work and will keep this open.

@diegosouzapw
Copy link
Copy Markdown
Owner

Thank you for the resilience model cooldown work, @rafacpti23! This PR has been reviewed and deferred to v4.0.0-rc1 to allow proper integration alongside the broader resilience layer changes planned for that cycle. Your PR will be kept open and merged with full credit in that release. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants