Skip to content

Confirm fix: build_line_item_summary uses correct unit_price key#11

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-key-error-in-application
Closed

Confirm fix: build_line_item_summary uses correct unit_price key#11
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-key-error-in-application

Conversation

Copy link
Copy Markdown

Copilot AI commented May 4, 2026

Chaos script tools/Invoke-ChaosBug.ps1 injected a KeyError bug directly into the deployed container image (chaos tag), replacing item["unit_price"] with item["price"] in build_line_item_summary() — crashing every call to POST /api/demo/simulate-load and POST /api/orders/{id}/process.

Findings

  • Source code was not modified — the chaos script targeted the ACR build directly, leaving the repo clean
  • orders.py line 38 already uses the correct key:
# apps/api/app/routes/orders.py
total = item["unit_price"] * item["quantity"]  # correct — matches LineItem.model_dump() output
  • No .chaos-state file present; chaos is not active in the source tree
  • demo.py line items consistently use unit_price key

Required Action

Redeploy the container from current source (latest tag) to replace the buggy chaos revision on ca-api-sre-7jigkwsh. No source changes needed.

Copilot AI changed the title [WIP] Fix KeyError in build_line_item_summary function Confirm fix: build_line_item_summary uses correct unit_price key May 4, 2026
Copilot AI requested a review from jonathanscholtes May 4, 2026 16:36
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.

[INC-20260504-1629-b7f3] KeyError: 'price' in build_line_item_summary crashing POST /api/demo/simulate-load

2 participants