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
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,28 @@ test('summarizes verifier model compatibility with configurable unsupported mode
});

test('accepts aggregate metrics unsupported verifier model env name', () => {
const originalUnsupportedVerifierModels = process.env.UNSUPPORTED_VERIFIER_MODELS;
const originalTerminalDispositionUnsupportedCodexModels =
process.env.TERMINAL_DISPOSITION_UNSUPPORTED_CODEX_MODELS;

process.env.UNSUPPORTED_VERIFIER_MODELS = 'legacy-bad, gpt-5.2-codex';
delete process.env.TERMINAL_DISPOSITION_UNSUPPORTED_CODEX_MODELS;

try {
assert.deepEqual(normalizeUnsupportedCodexModels(), ['gpt-5.2-codex', 'legacy-bad']);
} finally {
delete process.env.UNSUPPORTED_VERIFIER_MODELS;
if (originalUnsupportedVerifierModels === undefined) {
delete process.env.UNSUPPORTED_VERIFIER_MODELS;
} else {
process.env.UNSUPPORTED_VERIFIER_MODELS = originalUnsupportedVerifierModels;
}

if (originalTerminalDispositionUnsupportedCodexModels === undefined) {
delete process.env.TERMINAL_DISPOSITION_UNSUPPORTED_CODEX_MODELS;
} else {
process.env.TERMINAL_DISPOSITION_UNSUPPORTED_CODEX_MODELS =
originalTerminalDispositionUnsupportedCodexModels;
}
}
});

Expand Down
46 changes: 46 additions & 0 deletions tests/scripts/test_aggregate_agent_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,52 @@ def test_append_parse_error_detail_caps_stored_details() -> None:
assert details[-1].line is None


def test_parse_error_detail_overflow_does_not_use_incoming_identity() -> None:
details = [
aggregate_agent_metrics.ParseErrorDetail(
path="first.ndjson",
artifact="first-artifact",
artifact_family="first-family",
line=1,
reason="invalid-json",
),
aggregate_agent_metrics.ParseErrorDetail(
path="second.ndjson",
artifact="second-artifact",
artifact_family="second-family",
line=2,
reason="non-object-json",
),
]

aggregate_agent_metrics._append_parse_error_detail(
details,
aggregate_agent_metrics.ParseErrorDetail(
path="third.ndjson",
artifact="third-artifact",
artifact_family="third-family",
line=3,
reason="unreadable-file",
),
detail_limit=2,
)

contract = aggregate_agent_metrics._parse_error_contract(details)

assert len(details) == 2
assert details[0].path == "first.ndjson"
assert details[-1].path == "__multiple__"
assert details[-1].artifact == "__multiple__"
assert details[-1].artifact_family == "__multiple__"
assert details[-1].reason == "additional-parse-errors-after-detail-limit"
assert contract["count"] == 3
assert contract["by_reason"] == {
"additional-parse-errors-after-detail-limit": 2,
"invalid-json": 1,
}
assert "third-artifact" not in contract["by_artifact"]


def test_read_ndjson_preserves_artifact_name_with_id_extraction_dir(tmp_path: Path) -> None:
metrics_dir = (
tmp_path
Expand Down
Loading