Skip to content

Conversation

@jp-agenta
Copy link
Member

[feature] Add usage limits to agenta-provided keys

Copilot AI review requested due to automatic review settings November 11, 2025 15:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request appears to be focused on code cleanup and refactoring, primarily removing deprecated features and simplifying type definitions. The main changes involve removing "custom" evaluation types and eliminating unused code related to testsets, evaluations, and various SDK managers.

Key Changes:

  • Removed support for "custom" evaluation type, consolidating to "auto", "human", and "online" types only
  • Eliminated entire modules for testsets, evaluations, applications, evaluators management
  • Cleaned up SDK dependencies and removed unused imports
  • Simplified workflow interfaces by removing configuration-related code
  • Reorganized import paths and removed commented-out code

Reviewed Changes

Copilot reviewed 139 out of 546 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
web/ee/src/components/EvalRunDetails/* Removed "custom" eval type references throughout evaluation components
sdk/pyproject.toml Downgraded version from 0.62.0 to 0.60.0 and removed python-jsonpath dependency
sdk/agenta/sdk/workflows/* Refactored parameter handling, removed template expansion logic
sdk/agenta/sdk/managers/* Deleted entire manager modules for testsets, evaluators, applications
sdk/agenta/sdk/models/* Removed model definitions for testsets, evaluations, git entities
sdk/agenta/sdk/evaluations/* Deleted complete evaluation utilities and preview functionality
sdk/agenta/sdk/decorators/* Simplified workflow decorators, removed invoke/inspect helper functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

structlog = "^25.2.0"
huggingface-hub = "<0.31.0"
restrictedpython = { version = "^8.0", python = ">=3.11,<3.14" }
restrictedpython = { version = "^8.0", python = ">=3.11,<3.12" }
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The Python version constraint has been narrowed from '>=3.11,<3.14' to '>=3.11,<3.12', which reduces compatibility. This may break installations for Python 3.12 and 3.13 users. Consider if this restriction is intentional.

Suggested change
restrictedpython = { version = "^8.0", python = ">=3.11,<3.12" }
restrictedpython = { version = "^8.0", python = ">=3.11,<3.14" }

Copilot uses AI. Check for mistakes.
if not uri:
return True

return False
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The return value changed from 'True' to 'False' when uri is None in is_custom_uri(). This logic change may break existing functionality that expects None URIs to be treated as custom. Verify this is the intended behavior.

Suggested change
return False
return True

Copilot uses AI. Check for mistakes.
def echo(
*,
slug: Optional[str] = None,
slug: str,
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The 'slug' parameter has been changed from Optional[str] to required (str) across all workflow functions. This is a breaking API change that will require all callers to provide a slug value. Ensure this breaking change is documented and necessary.

Copilot uses AI. Check for mistakes.

try:
if not request.url.path in _ALWAYS_ALLOW_LIST:
await self._allow_local_secrets(credentials)
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

A new authentication check has been added that validates credentials before allowing access to secrets. However, the exception handling at line 126-128 catches DenyException but only prints the error without taking action. Consider whether secrets should still be allowed when authentication fails.

Copilot uses AI. Check for mistakes.
self,
#
slug: Optional[str] = None,
slug: str,
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The 'slug' parameter in the application class has changed from Optional[str] to required (str). This is a breaking change that requires all application instantiations to provide a slug. Document this breaking change in migration notes.

Copilot uses AI. Check for mistakes.
self,
#
slug: Optional[str] = None,
slug: str,
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The 'slug' parameter in the evaluator class has changed from Optional[str] to required (str). This is a breaking change that requires all evaluator instantiations to provide a slug. Document this breaking change in migration notes.

Copilot uses AI. Check for mistakes.
@@ -84,7 +84,7 @@

return {scenarioCount: scenarioIds.length}
} catch (error) {
console.error("[refreshLiveEvaluationRun] Failed to refresh run %s", runId, error)
console.error(`[refreshLiveEvaluationRun] Failed to refresh run ${runId}`, error)

Check failure

Code scanning / CodeQL

Use of externally-controlled format string High

Format string depends on a
user-provided value
.

Copilot Autofix

AI 2 months ago

To prevent possible exploitation from untrusted input in logging functions, avoid placing user-controlled data directly inside template literals used as the "format" string of console.error or similar methods. Instead, use a constant message as the format string and pass the untrusted data as separate arguments, which ensures they're rendered as literals, and prevents unexpected formatter injection by the user.

In web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts, update the problematic console.error call on line 87. Rather than interpolating runId, supply it as a second argument (e.g., "Failed to refresh run", runId, error). There is no need to add any imports. Only a single line needs editing; the rest of the functionality remains unchanged.


Suggested changeset 1
web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts b/web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts
--- a/web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts
+++ b/web/ee/src/lib/hooks/useEvaluationRunData/refreshLiveRun.ts
@@ -84,7 +84,7 @@
 
         return {scenarioCount: scenarioIds.length}
     } catch (error) {
-        console.error(`[refreshLiveEvaluationRun] Failed to refresh run ${runId}`, error)
+        console.error("[refreshLiveEvaluationRun] Failed to refresh run %s", runId, error)
         throw error
     }
 }
EOF
@@ -84,7 +84,7 @@

return {scenarioCount: scenarioIds.length}
} catch (error) {
console.error(`[refreshLiveEvaluationRun] Failed to refresh run ${runId}`, error)
console.error("[refreshLiveEvaluationRun] Failed to refresh run %s", runId, error)
throw error
}
}
Copilot is powered by AI and may make mistakes. Always verify output.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


GitHub CI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mmabrouk mmabrouk changed the base branch from main to release/v0.61.1 November 13, 2025 18:08
@mmabrouk mmabrouk changed the base branch from release/v0.61.1 to release/v0.60.2 November 13, 2025 18:08
@mmabrouk
Copy link
Member

This is stale. I reopened a clean PR here: #2957

@mmabrouk mmabrouk closed this Nov 13, 2025
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.

5 participants