pub struct DispatchContext {
pub conn_id: u64,
pub reads: ReadContext,
pub diff: Option<ProgrammaticDiffBus>,
pub review: ReviewHandle,
}Expand description
The state the dispatcher needs to answer tools/call: the read tools’
ReadContext + the write bus. Built once at
server spawn and shared (behind an Arc) across connections. The I1
methods (initialize / tools/list / prompts/list) ignore it.
Fields§
§conn_id: u64D-fix.6: the originating connection id — assigned per WS connection by
the server (serve_connection clones the shared context and stamps
this). Carried into openDiff (tags the diff’s origin_session) and
the close tools (scopes teardown to THIS connection’s diffs), so one
agent session can never tear down another’s diffs. 0 for the shared
boot context + dispatch tests (no real connection).
reads: ReadContextRead-tool services (cache + generic buffer-store / diagnostics +
workspace config). BC.3b / AG-2b: the write bus now rides inside
reads.editor (a lattice_agent::EditorAccess) — write tools call
ctx.reads.editor.open_file(...) etc. directly, no separate bus field.
diff: Option<ProgrammaticDiffBus>I4 openDiff host-drained bus ([ProgrammaticDiffBus]). None until
boot wires it (and in dispatch tests) — openDiff then returns a
graceful isError: true. Separate from writes because openDiff is
blocking + carries lattice-diff types that can’t cross the Effect
boundary (so it can’t ride the I3 handler bus).
review: ReviewHandleD-fix.6 follow-up: the shared pending-review tracker. openDiff brackets
its blocking await with review.begin(), so the modeline shows a
◆ review badge while the agent is blocked on the user — derived
entirely from claude-code’s own openDiff lifecycle (no host signal).
Trait Implementations§
Source§impl Clone for DispatchContext
impl Clone for DispatchContext
Source§fn clone(&self) -> DispatchContext
fn clone(&self) -> DispatchContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DispatchContext
impl !UnwindSafe for DispatchContext
impl Freeze for DispatchContext
impl Send for DispatchContext
impl Sync for DispatchContext
impl Unpin for DispatchContext
impl UnsafeUnpin for DispatchContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more