Skip to content

Commit b2a4e4c

Browse files
Kasper JungeRalphify
authored andcommitted
workspace: record msg alias inline in _apply_assistant
Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 52e0272 commit b2a4e4c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

workspace/ralphs/improve-codebase/coverage/_console_emitter.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# `_console_emitter.py` coverage
22

3-
Valid at: b19625e
3+
Valid at: 52e0272
44

55
## Recent changes
66

7+
- 52e0272 — inlined the `msg = raw.get("message", {})` local in
8+
`_IterationPanel._apply_assistant`. The alias was read exactly once on
9+
the next line as `msg.get("usage")`. Collapsing to
10+
`usage = raw.get("message", {}).get("usage")` matches the chained-get
11+
style already used by `_iter_content_blocks` two functions above
12+
(`raw.get("message", {}).get("content", [])`), and the same
13+
inline-alias pattern as 497c028 (`agent`) and fc5e1cb (`total_in`).
14+
No other reference to `msg` exists in the function — verified by grep.
715
- b19625e — dropped the `new_offset` alias in `_FullscreenPeek.scroll_down`.
816
The local was assigned directly to `self._offset`, then the
917
follow-mode check re-read it as `new_offset == 0` — identical to

workspace/ralphs/improve-codebase/iterations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
One line per iteration: `<sha> <summary>`.
44

5+
52e0272 refactor: inline `msg` alias in `_apply_assistant` — the `msg = raw.get("message", {})` local was read exactly once on the next line as `msg.get("usage")`. Collapsing into `raw.get("message", {}).get("usage")` matches the chained-get style already used by `_iter_content_blocks` (which independently does `raw.get("message", {}).get("content", [])`) and the inline-alias pattern from 497c028 / fc5e1cb.
6+
57
b19625e refactor: drop `new_offset` alias in `_FullscreenPeek.scroll_down` — the local was assigned to `self._offset` and then re-read only as `new_offset == 0`, which is identical to `self._offset == 0` after the assignment. Sibling `scroll_up` needs its local because it compares old vs new before the assignment; `scroll_down` has no such comparison, so the alias was dead. Same shape as ef176bf and 134078d.
68

79
497c028 refactor: inline `agent` alias in `_on_run_started` — the local served a single use as the arg to `_is_claude_command(...)`. Reading `data["agent"]` directly matches the sibling style from fc5e1cb (`total_in` inline). Preserved `ralph_name` — it's used inside an f-string on line 1247 where the alias still helps readability.

0 commit comments

Comments
 (0)