conversation: absorb tick into the actor via Inbound::Tick #69

Merged
JakeHillion merged 1 commits from jj/stnynprqkuoz into main 2026-05-11 23:22:42 +01:00
Owner

The conversation actor exposed three legacy escape hatches —
legacy_push, legacy_set_prompt_tokens, legacy_maybe_compact — that
let tick.rs drive a chat turn manually instead of going through
Inbound. This duplicated run_turn and left per-room state mutable
from outside the actor.

Added an Inbound::Tick { body, sent_at } variant. run_turn now takes
a tick: bool that flips ctx.tick (making tick_silent available)
and skips appending the empty assistant message when the model declines
silently; the Tick arm of handle_inbound returns None in that
case. tick_room is now a single deliver call. legacy_maybe_compact
is deleted; the remaining two helpers and their envelope variants are
gated behind #[cfg(test)] and renamed test_* because the
conversation tests still use them to seed history. Removed the
now-unused AppState.personality and AppState.tool_registry fields —
the actor reads them via ConversationDeps.

Per-room state is now mutated exclusively through Inbound, the
silent-tick path shares all bookkeeping (history append, token
tracking, compaction) with every other turn, and the existing LLM-side
tick_silent early-exit drives the decline cleanly.

Test plan:

  • CI
The conversation actor exposed three legacy escape hatches — `legacy_push`, `legacy_set_prompt_tokens`, `legacy_maybe_compact` — that let `tick.rs` drive a chat turn manually instead of going through `Inbound`. This duplicated `run_turn` and left per-room state mutable from outside the actor. Added an `Inbound::Tick { body, sent_at }` variant. `run_turn` now takes a `tick: bool` that flips `ctx.tick` (making `tick_silent` available) and skips appending the empty assistant message when the model declines silently; the `Tick` arm of `handle_inbound` returns `None` in that case. `tick_room` is now a single `deliver` call. `legacy_maybe_compact` is deleted; the remaining two helpers and their envelope variants are gated behind `#[cfg(test)]` and renamed `test_*` because the conversation tests still use them to seed history. Removed the now-unused `AppState.personality` and `AppState.tool_registry` fields — the actor reads them via `ConversationDeps`. Per-room state is now mutated exclusively through `Inbound`, the silent-tick path shares all bookkeeping (history append, token tracking, compaction) with every other turn, and the existing LLM-side `tick_silent` early-exit drives the decline cleanly. Test plan: - CI
JakeHillion added 1 commit 2026-05-11 23:14:20 +01:00
The conversation actor exposed three legacy escape hatches —
`legacy_push`, `legacy_set_prompt_tokens`, `legacy_maybe_compact` — that
let `tick.rs` drive a chat turn manually instead of going through
`Inbound`. This duplicated `run_turn` and left per-room state mutable
from outside the actor.

Added an `Inbound::Tick { body, sent_at }` variant. `run_turn` now takes
a `tick: bool` that flips `ctx.tick` (making `tick_silent` available)
and skips appending the empty assistant message when the model declines
silently; the `Tick` arm of `handle_inbound` returns `None` in that
case. `tick_room` is now a single `deliver` call. `legacy_maybe_compact`
is deleted; the remaining two helpers and their envelope variants are
gated behind `#[cfg(test)]` and renamed `test_*` because the
conversation tests still use them to seed history. Removed the
now-unused `AppState.personality` and `AppState.tool_registry` fields —
the actor reads them via `ConversationDeps`.

Per-room state is now mutated exclusively through `Inbound`, the
silent-tick path shares all bookkeeping (history append, token
tracking, compaction) with every other turn, and the existing LLM-side
`tick_silent` early-exit drives the decline cleanly.

Test plan:
- CI
JakeHillion scheduled this pull request to auto merge when all checks succeed 2026-05-11 23:17:24 +01:00
JakeHillion merged commit 3b23674d83 into main 2026-05-11 23:22:42 +01:00
JakeHillion deleted branch jj/stnynprqkuoz 2026-05-11 23:22:43 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JakeHillion/personal-agent#69