Can we add a short summary to the notification message?
Now I can see the notification messages sent from ralph.sh. Let me look at the key notification calls:
Start (line 596): :rocket: *Ralph Started*\n\``Plan: $PLAN_BASENAME\nMode: $MODE\nRepo: $REPO_NAME````
Complete (line 667): :white_check_mark: *Ralph Complete!*\n\``Plan: $PLAN_BASENAME\nIterations: $ITERATION\nRepo: $REPO_NAME````
Max iterations (line 676): :warning: *Ralph Stopped*\n\``Plan: $PLAN_BASENAME\nReason: Max iterations reached ($MAX_ITERATIONS)\nRepo: $REPO_NAME````
Error (line 859): :x: *Ralph Error*\n\``Plan: $PLAN_BASENAME\nIteration: $ITERATION\nError: $error_type (after $claude_attempt retries)\nRepo: $REPO_NAME````
Progress (line 889): The notification appears to be cut off, but it's tracking progress updates during execution.
Planning complete (line 874): :clipboard: *Ralph Planning Complete!*\n\``Plan: $PLAN_BASENAME\nTask list created in: $PROGRESS_FILE\nRepo: $REPO_NAME````
The user wants to add a short summary to these notification messages, probably pulling recent accomplishments from the progress file to give more context about what Ralph actually did in each iteration. I'm thinking about how to extract that summary ā maybe the last few lines or most recent task status from the progress file would work well.
The straightforward approach is to create a function that pulls a short summary from the progress file and then weave that into the notification messages for progress updates, completion, and stopped states. I'll write a function to extract those recent lines and include them in the relevant notifications.
Now I understand the notification flow. The notifications are sent from ralph.sh at various points (start, progress, complete, error, etc.) but they don't include any summary of what was accomplished. I'll add a function to extract a short summary from the progress file and include it in the relevant notifications.
Let me check what the progress file typically looks like.
The user wants to add a short summary to the notification message. Let me first understand the codebase - this seems to be about the Ralph project. Let me look at the notification-related code to understand what's currently happening.
Let me check the relevant files to understand the notification system.
Good, now I can see the progress file format. The progress file has a task list with [x] for completed and [ ] for pending tasks. I'll add a function to extract a brief summary (last completed task or task counts) and include it in the notification messages.
Now I'll add the summary function and update the notification messages.
Now update the notification messages to include the summary. Let me update the completion, max-iterations, progress, and error notifications.
Let me look at how notifications are currently sent.
Now let me verify the changes look correct.
Let me also quickly verify the notification call sites look right.
Let me also do a quick syntax check.
>bash -n /mnt/dest-btrfs/home/jc/ralph/ralph.shSyntax is clean. Here's what I added:
get_progress_summary() - parses the progress file and returns a compact summary like:
Tasks: 3/7Last: Add input validation to API endpointsThis summary is now appended to all four notification types:
The summary is omitted if there's no task list yet (e.g., the start notification stays unchanged). Task names longer than 60 chars get truncated with ....
Tasks: 3/7Last: Add input validation to API endpoints