a2a-source-edit: write agent.py
This commit is contained in:
10
agent.py
10
agent.py
@@ -165,18 +165,22 @@ class ProductionProofV116HighUtili72552(
|
|||||||
warnings=["Use blocks with From:, Subject:, and Body: fields for best results."],
|
warnings=["Use blocks with From:, Subject:, and Body: fields for best results."],
|
||||||
)
|
)
|
||||||
|
|
||||||
queue = [_triage_message(message, policy) for message in messages]
|
queue: list[QueueItem] = []
|
||||||
queue.sort(key=lambda queue_entry: _priority_rank(queue_entry.priority))
|
for message in messages:
|
||||||
|
queue.append(_triage_message(message, policy))
|
||||||
|
queue.sort(key=_queue_sort_key)
|
||||||
urgent_count = 0
|
urgent_count = 0
|
||||||
|
report_queue: list[dict[str, Any]] = []
|
||||||
for queue_entry in queue:
|
for queue_entry in queue:
|
||||||
if queue_entry.priority == "urgent":
|
if queue_entry.priority == "urgent":
|
||||||
urgent_count += 1
|
urgent_count += 1
|
||||||
|
report_queue.append(queue_entry.model_dump(mode="json"))
|
||||||
summary = _summary(queue)
|
summary = _summary(queue)
|
||||||
report = {
|
report = {
|
||||||
"generated_at": datetime.now(UTC).isoformat(),
|
"generated_at": datetime.now(UTC).isoformat(),
|
||||||
"summary": summary,
|
"summary": summary,
|
||||||
"approval_boundary": _approval_boundary(),
|
"approval_boundary": _approval_boundary(),
|
||||||
"queue": [queue_entry.model_dump(mode="json") for queue_entry in queue],
|
"queue": report_queue,
|
||||||
}
|
}
|
||||||
report_bytes = json.dumps(report, indent=2, ensure_ascii=False).encode("utf-8")
|
report_bytes = json.dumps(report, indent=2, ensure_ascii=False).encode("utf-8")
|
||||||
artifact = await ctx.write_artifact(
|
artifact = await ctx.write_artifact(
|
||||||
|
|||||||
Reference in New Issue
Block a user