refactor(daemon): type the hook dispatch against the agent SDK - #125
Merged
Conversation
This was referenced Jul 17, 2026
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 17, 2026
rgao-coreweave
marked this pull request as ready for review
July 17, 2026 18:14
rgao-coreweave
force-pushed
the
109-04-typed-hooks
branch
from
July 17, 2026 20:18
d0cac31 to
fc49f9b
Compare
rgao-coreweave
force-pushed
the
109-03-config-extract
branch
from
July 17, 2026 20:18
1a97da0 to
2761356
Compare
rgao-coreweave
force-pushed
the
109-04-typed-hooks
branch
from
July 17, 2026 20:34
fc49f9b to
5a228b8
Compare
rgao-coreweave
force-pushed
the
109-03-config-extract
branch
from
July 17, 2026 20:34
2761356 to
7693513
Compare
rgao-coreweave
changed the base branch from
109-03-config-extract
to
graphite-base/125
July 17, 2026 20:36
Cast the socket JSON once against the SDK's HookInput and dispatch on the
discriminant, so handlers take typed inputs instead of re-casting every
field (~40 payload[...] as X casts deleted). Fields the SDK types as
required drop their invented fallbacks ('unknown'/'teammate'/'?'); the two
payloads that carry more than the SDK declares (PreCompact summary/counts,
reconstruction source/model) keep documented raw-record reads.
Behavior notes: PostToolUseFailure now trusts the typed `error` field
(drops the undocumented tool_response fallback), and InstructionsLoaded
drops its missing-file_path branch (the type requires it; a bad path still
lands in the unreadable-file catch).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rgao-coreweave
force-pushed
the
109-04-typed-hooks
branch
from
July 17, 2026 20:39
5a228b8 to
00f9c62
Compare
rgao-coreweave
force-pushed
the
graphite-base/125
branch
from
July 17, 2026 20:39
7693513 to
2aaf71b
Compare
Contributor
Author
Merge activity
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Casts the socket JSON once against the SDK's
HookInputand dispatches on the discriminant, so handlers take typed inputs. Deletes ~40payload['x'] as Tcasts.'unknown','teammate','?').Behavior notes: PostToolUseFailure trusts the typed
errorfield and drops the undocumentedtool_responsefallback; InstructionsLoaded drops its missing-file_pathbranch (the type requires it, and unreadable paths still hit the existing catch).Test plan:
npm run check(84 tests; two test harnesses updated to the new handler signatures)🤖 Generated with Claude Code