Skip to content

chore(deps): bump geny-executor → 2.0.6 + slim down llm_patches.py#828

Merged
CocoRoF merged 1 commit into
mainfrom
chore/executor-2.0.6-pin-bump
May 20, 2026
Merged

chore(deps): bump geny-executor → 2.0.6 + slim down llm_patches.py#828
CocoRoF merged 1 commit into
mainfrom
chore/executor-2.0.6-pin-bump

Conversation

@CocoRoF
Copy link
Copy Markdown
Owner

@CocoRoF CocoRoF commented May 20, 2026

geny-executor 2.0.6 (CocoRoF/geny-executor#208) absorbed four of the five compat patches that previously lived in `service/llm_patches.py`. This PR bumps the pin and removes the now-redundant Geny-side monkey-patches.

What landed in 2.0.6

  • A. `--verbose` auto-injected when `--print --output-format=stream-json` is used (required by Claude Code CLI ≥ 2.1.x).
  • B. `--bare` auto-stripped when no `ANTHROPIC_API_KEY` is in env, so the OAuth subscription path no longer crashes.
  • C. Dropped the auto-`--tools ""` emit on MCP-configured spawns — CLI built-ins (`Bash` / `Read` / `Write` / `Edit` / …) now stay available alongside MCP-wrapped host tools.
  • D. `StreamJsonAccumulator.finalize` (and `parse_json_output_to_response`) now drop the `tool_use` blocks the CLI dispatched internally, so Stage 10 naturally no-ops instead of ghost-erroring against the `mcp__geny__` ids it has no registration for.

Plus the executor lost the dead `copilot_cli` provider entirely (Geny removed its end in #827).

Pin bump

`>=2.0.5` → `>=2.0.6` in both `pyproject.toml` and `requirements.txt`.

`llm_patches.py` slim-down

830 → 479 lines (~350 lines deleted).

Removed:

  • `_patched_argv` predicate (4 fixes A/B/C now native in 2.0.6)
  • `_install_stream_accumulator_patch` (`tool_use` strip now native)
  • Associated cached-wrapper bookkeeping for those installers

Kept (both Geny-specific):

  1. Friendly Korean error messages for `is_error` stream-json result envelopes — auth-expired → Settings card hint, generic API errors → structured short message. Will fold upstream once the executor gains a proper i18n hook.
  2. CLI-tool observability via the new `cli_stream_logger_ctx` ContextVar — taps `StreamJsonAccumulator.feed` to surface CLI built-in tool calls (`Bash` / `Read` / `Write` / `Edit` / …) into Geny's session log alongside the MCP tool entries that `mcp_bridge_controller` already emits. `mcp__*` prefixed names are skipped so the bridge-side log isn't double-rendered. Will fold upstream once the executor emits first-class CLI-tool events on the pipeline event bus.

Test rewrite

21 → 14 focused tests. Old tests covered the deleted `_patched_argv` predicate; new tests cover what's actually left:

  • `_friendly_error_message_for_result_envelope` — 3 cases (auth, generic API error, CLI fallback).
  • `_maybe_extract_error_envelope` — bytes/str input + 7 parametrised non-match cases.
  • `install_llm_patches` idempotency + re-export coverage across the three modules that import the assembler.
  • Assembler patch end-to-end: raises Korean friendly error on auth-failure envelope; passes through clean streams.
  • Stream observability: emits `log_tool_use` for non-MCP tool blocks; skips `mcp__*` to avoid bridge double-render; emits `log_tool_result` with measured duration; handles both string and content-block-list result shapes; inert when no ContextVar is set.

Companion stages

🤖 Generated with Claude Code

…s.py

geny-executor 2.0.6 (released today, see CocoRoF/geny-executor#208)
absorbed four of the five compat patches that previously lived in
``service/llm_patches.py``:

  A. ``--verbose`` auto-injected when ``--print --output-format=
     stream-json`` is used (required by Claude Code CLI ≥ 2.1.x).
  B. ``--bare`` auto-stripped when no ``ANTHROPIC_API_KEY`` is in
     env, so the OAuth subscription path no longer crashes.
  C. Dropped the auto-``--tools ""`` emit on MCP-configured spawns —
     CLI built-ins (``Bash`` / ``Read`` / ``Write`` / ``Edit`` / …)
     now stay available alongside MCP-wrapped host tools, which is
     what every host (notably Geny's Sub-Worker) actually wants.
  D. ``StreamJsonAccumulator.finalize`` (and ``parse_json_output_to_response``)
     now drop the ``tool_use`` blocks the CLI dispatched internally,
     so Stage 10 naturally no-ops instead of ghost-erroring against
     the ``mcp__geny__<name>`` ids it has no registration for.

Plus the executor lost the dead ``copilot_cli`` provider entirely
(Geny had already removed its end of that wiring in #827).

This bumps both pins (``pyproject.toml`` + ``requirements.txt``)
from ``>=2.0.5`` to ``>=2.0.6``.

``llm_patches.py`` shrinks from ~830 lines to ~479 lines. Two
patches remain — both are Geny-specific and won't fold upstream
without the executor gaining hooks Geny is the only consumer of:

  1. Friendly Korean error messages for ``is_error`` stream-json
     result envelopes (auth-expired → Settings card hint, generic
     API errors → structured short message). Will fold upstream once
     the executor gains a proper i18n hook.

  2. CLI-tool observability into Geny's :class:`SessionLogger` via
     the new :data:`cli_stream_logger_ctx` ContextVar — taps
     ``StreamJsonAccumulator.feed`` to surface CLI built-in tool
     calls (Bash / Read / Write / Edit / …) into the session log
     alongside the MCP tool entries that ``mcp_bridge_controller``
     already emits. ``mcp__*`` prefixed names are skipped so the
     bridge-side log isn't double-rendered. Will fold upstream
     once the executor emits first-class CLI-tool events on the
     pipeline event bus.

Tests are rewritten end-to-end:

  - Old: 21 tests for ``_patched_argv`` predicate + idempotent
    installer (the patched-argv function is gone).
  - New: 14 focused tests covering:
    - ``_friendly_error_message_for_result_envelope`` (3 cases:
      auth, generic API error, fallback).
    - ``_maybe_extract_error_envelope`` (bytes/str input + 7
      parametrised non-match cases).
    - ``install_llm_patches`` idempotency + re-export coverage.
    - Assembler patch end-to-end: raises Korean friendly error
      on auth-failure envelope; passes through clean streams.
    - Stream observability: emits ``log_tool_use`` for non-MCP
      tool blocks; skips ``mcp__*`` to avoid bridge double-render;
      emits ``log_tool_result`` with duration; handles both
      string and content-block-list result shapes; inert when
      no ContextVar is set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CocoRoF CocoRoF merged commit b9e191c into main May 20, 2026
1 check passed
@CocoRoF CocoRoF deleted the chore/executor-2.0.6-pin-bump branch May 20, 2026 07:50
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