Skip to content

Commit 886c49b

Browse files
committed
fix: preserve Luna context-limit error code
1 parent 15fc749 commit 886c49b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎evaluators/contrib/galileo/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Integration package for Galileo Luna evaluator.
44

5+
## Context-limit errors
6+
7+
If the model server rejects an input for exceeding its maximum context length,
8+
the evaluator returns `metadata.error_code: context_limit`. The server still
9+
redacts the error message. Clients can use this safe code to report an unsupported
10+
input separately from transient evaluator failures without exposing internal error
11+
details or retrying the same oversized input.
12+
513
## Migrating from Luna2
614

715
The `galileo.luna2` evaluator ID has been removed. Existing controls that use

‎evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/evaluator.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ def _handle_error(
359359
**self._base_metadata(),
360360
"error_type": type(error).__name__,
361361
}
362+
# The server redacts error text, so retain this deterministic failure as
363+
# a safe code that clients can distinguish from an evaluator outage.
364+
if isinstance(error, RuntimeError) and error_detail.startswith(
365+
"Input exceeds maximum length for Galileo model server:"
366+
):
367+
metadata["error_code"] = "context_limit"
362368
if isinstance(error, httpx.HTTPStatusError):
363369
metadata.update(_http_status_error_metadata(error))
364370

0 commit comments

Comments
 (0)