Add detailed Copilot instructions and enhance child API logging
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 14s

- Introduced a comprehensive instructions document for the Reward project, outlining architecture, data flow, key patterns, and developer workflows.
- Enhanced logging in the child API to track points and reward costs, improving error handling for insufficient points.
- Updated Vue components to reflect changes in reward handling and improve user experience with pending rewards.
This commit is contained in:
2026-01-21 16:35:50 -05:00
parent 59b480621e
commit a47df7171c
6 changed files with 325 additions and 107 deletions

View File

@@ -29,6 +29,7 @@ def get_queue(user_id: str, connection_id: str) -> queue.Queue:
def send_to_user(user_id: str, data: Dict[str, Any]):
"""Send data to all connections for a specific user."""
logger.info(f"Sending data to {user_id} user quesues are {user_queues.keys()}")
logger.info(f"Data: {data}")
if user_id in user_queues:
logger.info(f"Queued {user_id}")
# Format as SSE message once
@@ -37,8 +38,6 @@ def send_to_user(user_id: str, data: Dict[str, Any]):
# Send to all connections for this user
for connection_id, q in user_queues[user_id].items():
try:
logger.info(f"Sending message to {connection_id}")
q.put(message)
q.put(message, block=False)
except queue.Full:
# Skip if queue is full (connection might be dead)
@@ -61,7 +60,6 @@ def sse_response_for_user(user_id: str):
try:
while True:
# Get message from queue (blocks until available)
logger.info(f"blocking on get for {user_id} user")
message = user_queue.get()
yield message
except GeneratorExit: