refactor(agent): fold post-refresh metrics push into the inline handler #2

Merged
mathew merged 1 commit from agent-inline-garage-refresh into main 2026-06-03 17:58:25 +00:00
Owner

The garage_refresh dispatch path had two string-compares to "garage_refresh" inside handle_command_request and two parallel post-success-metrics-push mechanisms (push_post_refresh_metrics for the inline path, post_success_hook for long-runners) that were structurally redundant.

This commit folds the inline path's full ceremony: collect, send result, pulse-log, push metrics on success - into handle_garage_refresh itself, so dispatch can early-return on that branch the same way it does for long-running commands. handle_garage_refresh's pure result-building step is exposed as a public collect_refresh_result for unit tests; push_post_refresh_metrics deletes.

One string-compare survives in dispatch (selecting the path); the trailing "is this still that special case?" tail-clause is gone. Net -10 lines, 1126/1126 tests pass, fitness and import-linter green.

The garage_refresh dispatch path had two string-compares to "garage_refresh" inside handle_command_request and two parallel post-success-metrics-push mechanisms (push_post_refresh_metrics for the inline path, post_success_hook for long-runners) that were structurally redundant. This commit folds the inline path's full ceremony: collect, send result, pulse-log, push metrics on success - into handle_garage_refresh itself, so dispatch can early-return on that branch the same way it does for long-running commands. handle_garage_refresh's pure result-building step is exposed as a public collect_refresh_result for unit tests; push_post_refresh_metrics deletes. One string-compare survives in dispatch (selecting the path); the trailing "is this still that special case?" tail-clause is gone. Net -10 lines, 1126/1126 tests pass, fitness and import-linter green.
refactor(agent): fold post-refresh metrics push into the inline handler
All checks were successful
Tests / test (pull_request) Successful in 1m12s
Tests / fitness (pull_request) Successful in 38s
f42c79f320
mathew merged commit e260980872 into main 2026-06-03 17:58:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
official-public/storm-pulse!2
No description provided.