Skip to content

Implementation Plan: Thread session_locator into flush_session_log and Migrate 15 Monkeypatch Sites#3982

Open
Trecek wants to merge 3 commits into
developfrom
t4-p3-a8-wp1-thread-session-locator-into-flush-session-log-a/3928
Open

Implementation Plan: Thread session_locator into flush_session_log and Migrate 15 Monkeypatch Sites#3982
Trecek wants to merge 3 commits into
developfrom
t4-p3-a8-wp1-thread-session-locator-into-flush-session-log-a/3928

Conversation

@Trecek

@Trecek Trecek commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the direct claude_code_log_path(cwd, session_id) call in flush_session_log (session_log.py:190) with Protocol-dispatched SessionLocator.session_log_path(). Add a session_locator: SessionLocator | None = None kwarg with lazy ClaudeSessionLocator() fallback. Migrate all 15 monkeypatch.setattr sites in test_session_log_fields.py to explicit injection via a _FakeLocator test helper, update _flush() in conftest.py to forward the new parameter, and update structural guard tests in test_flush_completeness_guard.py and test_session_log_flush.py.

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260610-002248-121925/.autoskillit/temp/make-plan/thread_session_locator_flush_session_log_plan_2026-06-10_002700.md

Closes #3928

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 63 24.6k 1.4M 108.9k 54 87.6k 11m 57s
verify* sonnet 1 76 10.5k 403.9k 57.2k 26 36.3k 7m 56s
implement* MiniMax-M3 1 6.3M 22.2k 0 0 129 0 11m 5s
audit_impl* sonnet 1 922 7.9k 171.9k 47.7k 13 35.5k 5m 14s
prepare_pr* MiniMax-M3 1 200.5k 2.3k 0 0 14 0 58s
compose_pr* MiniMax-M3 1 176.7k 1.4k 0 0 12 0 47s
Total 6.7M 68.9k 1.9M 108.9k 159.4k 37m 57s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 168 0.0 0.0 132.1
audit_impl 0
prepare_pr 0
compose_pr 0
Total 168 11469.3 948.6 409.9

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 63 24.6k 1.4M 87.6k 11m 57s
sonnet 2 998 18.4k 575.8k 71.7k 13m 10s
MiniMax-M3 3 6.7M 25.9k 0 0 12m 50s

Trecek added 3 commits June 10, 2026 01:26
…atch

Replace the direct claude_code_log_path(cwd, session_id) call in
flush_session_log with Protocol-dispatched resolution through
SessionLocator.session_log_path(). Add a session_locator kwarg with
lazy ClaudeSessionLocator() fallback to avoid import-time coupling
between session_log and the backends module.

Migration:
- 15 monkeypatch.setattr sites in test_session_log_fields.py replaced
  with explicit injection via _FakeLocator test helper
- conftest._flush() updated to accept and forward session_locator
- 2 new structural guard tests:
  - test_session_locator_is_optional_parameter (signature guard)
  - test_flush_helper_forwards_session_locator (forwarding guard)

This unblocks dispatching the cc_log resolution through any backend
that supplies a SessionLocator (Codex, future backends) without
hard-coupling to the claude module.
…-before-optional convention

session_locator (optional, None default) was placed before telemetry (required,
no default) breaking the keyword-only parameter ordering convention. All callers
use keyword syntax so this is a non-breaking reorder.
…ion_locator param

The helper's session_locator parameter was untyped, diverging from the
flush_session_log signature it wraps.
@Trecek Trecek force-pushed the t4-p3-a8-wp1-thread-session-locator-into-flush-session-log-a/3928 branch from 76494bd to a21650b Compare June 10, 2026 08:26
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.

1 participant