Repository navigation
Add shared structured context/thinking presentation and fix Qt ContextExplorer native reads - #2273
Merged
Merged
Conversation
…tExplorer native reads
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.
Summary
Puts structured
<think>,<ctx>,<tool_call>,Certainty:(DEDUCED/ASSUMED/UNKNOWN/REFUTED/OBSERVED + Basis + Confidence), and[[CTX_TURN]]/=== SECTION ===presentation at the top UI-backend layer (toad.client/toad.core) so Textual, Qt desktop, Android APK, and Web (toad serve) all inherit it from one owner with zero per-frontend forks.Changes
src/toad/client/structured_context.py: NominalStructuredPartfamily (ThinkingPart,ContextSectionPart,LiveContextPart,ToolCallPart,AnswerPart) andStructuredTag(DeclaredFamily, affix='Tag')(ThinkTag,CtxTag,ToolCallTag), linear-time parser handling both closed and streaming unclosed tags, plus compact 50-col mobile-friendly labels.src/toad/client/agent_activity.py:AgentActivityPresentation.thinking()delegates toThinkingPart.from_text().line_blocks()(live TextualAgentThought, live QtQtThoughtBlock, and savedThinkingTranscript).src/toad/client/transcript_fragments.py&src/toad/message_rows.py: Split inline structured tags viaparse_structured_textwhen present so neither transcripts nor bridged wire messages leak raw XML tags.src/toad/core/context_inspection.py: AddedStructuredSectionNodeandPiMessageParts(MroProjection);NativeMessageNodeandNativeSegmentNode/RecordedSegmentNodeexpand thinking, certainty claims,<ctx>sections, and tool calls as collapsible tree nodes while preservingpublic_text()search exclusion of private thinking.src/toad/qt/context_panel.py: FixedQtContextExplorernever callingprepare_native()(leaving live threads stuck onReading native context…on Qt desktop & Android), wired sharedholding.find()search, added lazy child expansion matching Textual'sContextTree._expand, and added compactOlder/Newer/Refresh/Copytoolbar + word wrap.tests/model/test_structured_context.pyand updatedtests/support/context_reads.py(DirectCoreAccess) +tests/support/overlapping_annotations.py(keyword-onlyModelLabel) for Corecore-03b277691.Verification
27 passedin7.33s(test_structured_context.py,test_context_inspection_source.py,test_context_reader_session_revision.py,test_fragment_source_occurrence.py,test_wire_message_lines.py,test_shared_frontend_members.py).CLM-tristan(879 msgs -> 458 expanded nodes) andclm-live(4 msgs -> 4 certainty claims, 0 raw tag leaks).PRE-SPLASH 253/POST-LOAD 1758(comms=False,pkg=False).qt_inherit_ratchet.py= 0,shadow_check.py= 0,guarded_imports.py= 0,rel_imports= 0.