Repository navigation
feat(observe): report turn-setup phases through TurnObservation::Setup - #718
Merged
Merged
Conversation
…rvation::Setup Co-authored-by: Medulla <medulla@tinyhumans.ai>
Agent open, transcript resume, prompt refresh and the memory block each report their duration and outcome to the turn's observer before the first model request. A memory block that missed its deadline is Skipped and a failed read is Failed. SetupPhase and SetupOutcome are re-exported from openhuman_embed::observe. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #713
Part of tinyhumansai/chottu-core#712
What changed
vendor/tinyagentsto the senamakel/tinyagents epic tip (bdf8f4b7), which brings inTurnObservation::Setup,SetupPhaseandreport_setup(tinyagents#205) besideReasoningReplay([tinyagents-slim] relocate: parent-context builder totriage/#203) andprune_retired_tools([tinyagents-slim] relocate:harness/fork_context.rsintosubagent_host/#204). The bump compiles cleanly.agent::session_host::setup_report::reported, which times a future and callsreport_setup(a no-op without a scoped observer).AgentOpenaroundbuild_turn_agentinagent_chat/session_turn.rs.TranscriptResumearoundruntime.resumeinruntime_session_turn.rs.PromptRefresharound the prompt render (cold_prompt_prefix, which both the cold start and refresh-on-resume use).MemoryBlockaroundblock_for_generation:Skippedwhen the deadline lapsed,Failedwhen the read failed, elseCompleted.openhuman_embed::observere-exportsSetupPhaseandSetupOutcome;OBSERVERS.mddescribes the new observation.memory_block) reports nothing. I did not add separate tool-snapshot or prewarm phases: the snapshot is a synchronous in-memory build, andprewarm_memory_blockruns outside any turn, so no observer scope exists to report to.TurnObservationmatch intests/observed_turns.rs(aSetuparm).Tests
setup_phases_are_reported_in_order(crates/openhuman-embed/tests/setup_phases.rs): a cold thread-bound turn reports agent_open, transcript_resume, prompt_refresh, memory_block, then the firstModelevent. Failed against the unwired code (onlymodel), passes now.setup_reportunit tests: outcomes, elapsed time and the unscoped no-op.TMPDIRis under the symlinked/var/folders. Running withTMPDIRset to a real path (no symlink) makes it pass, so it ran locally; the pre-existingmemory_blockembed test passes the same way.Gates (vendor/openhuman)
cargo fmt --all -- --check: passcargo clippy -p openhuman -p openhuman-embed --lib -- -D warnings: passcargo clippy -p openhuman-embed --all-targets -- -D warnings: pass (core--all-targetshas 23 pre-existing test lints, not run)cargo test -p openhuman --lib setup_report2/2,memory_block39/39,runtime_session_turn: no matches;prompt_refresh13/15cargo test -p openhuman-embed --test setup_phasesand--test memory_block: passPre-existing failures (also fail on the epic base)
prompt_refresh::resume_refreshes_the_prompt_without_an_integrations_backendanda_resumed_thread_takes_up_the_current_prompt_only_when_its_agent_opts_inhang.agent_chat_for_rejects_an_unknown_agent_idandobserved_turnsfail with "Prompt flagged for security review" from the prompt guard before any setup phase runs.