Port missing features to gui_2 and optimize caching

- Port 10 missing features from gui.py to gui_2.py: performance
    diagnostics, prior session log viewing, token budget visualization,
    agent tools config, API hooks server, GUI task queue, discussion
    truncation, THINKING/LIVE indicators, event subscriptions, and
    session usage tracking
  - Persist window visibility state in config.toml
  - Fix Gemini cache invalidation by separating discussion history
    from cached context (use MD5 hash instead of built-in hash)
  - Add cost optimizations: tool output truncation at source, proactive
    history trimming at 40%, summary_only support in aggregate.run()
  - Add cleanup() for destroying API caches on exit
This commit is contained in:
2026-02-23 20:06:13 -05:00
parent 75e1cf84fe
commit 69401365be
6 changed files with 556 additions and 152 deletions

View File

@@ -27,7 +27,7 @@ DockId=0x00000015,0
[Window][Discussion History]
Pos=598,128
Size=712,619
Size=554,619
Collapsed=0
DockId=0x0000000E,0
@@ -39,7 +39,7 @@ DockId=0x0000000A,0
[Window][Message]
Pos=598,749
Size=712,451
Size=554,451
Collapsed=0
DockId=0x0000000C,0
@@ -50,22 +50,22 @@ Collapsed=0
DockId=0x00000010,0
[Window][Tool Calls]
Pos=1312,733
Size=368,144
Pos=1154,733
Size=526,144
Collapsed=0
DockId=0x00000008,0
[Window][Comms History]
Pos=1312,879
Size=368,321
Pos=1154,879
Size=526,321
Collapsed=0
DockId=0x00000006,0
[Window][System Prompts]
Pos=1312,0
Size=368,731
Pos=1154,0
Size=286,731
Collapsed=0
DockId=0x00000007,0
DockId=0x00000017,0
[Window][Theme]
Pos=209,173
@@ -78,11 +78,17 @@ Pos=379,324
Size=900,700
Collapsed=0
[Window][Diagnostics]
Pos=1442,0
Size=238,731
Collapsed=0
DockId=0x00000018,0
[Docking][Data]
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=138,161 Size=1680,1200 Split=X
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=346,232 Size=1680,1200 Split=X
DockNode ID=0x00000011 Parent=0xAFC85805 SizeRef=207,1200 Selected=0x0469CA7A
DockNode ID=0x00000012 Parent=0xAFC85805 SizeRef=1559,1200 Split=X
DockNode ID=0x00000003 Parent=0x00000012 SizeRef=1189,1200 Split=X
DockNode ID=0x00000003 Parent=0x00000012 SizeRef=943,1200 Split=X
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=387,1200 Split=Y Selected=0x8CA2375C
DockNode ID=0x00000009 Parent=0x00000001 SizeRef=405,911 Split=Y Selected=0x8CA2375C
DockNode ID=0x0000000F Parent=0x00000009 SizeRef=405,733 Split=Y Selected=0x8CA2375C
@@ -92,14 +98,16 @@ DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=138,161 Size=1680,12
DockNode ID=0x00000014 Parent=0x0000000F SizeRef=405,337 Selected=0xDA22FEDA
DockNode ID=0x00000010 Parent=0x00000009 SizeRef=405,176 Selected=0x0D5A5273
DockNode ID=0x0000000A Parent=0x00000001 SizeRef=405,287 Selected=0xA07B5F14
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=800,1200 Split=Y
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=554,1200 Split=Y
DockNode ID=0x0000000B Parent=0x00000002 SizeRef=1010,747 Split=Y
DockNode ID=0x0000000D Parent=0x0000000B SizeRef=1010,126 CentralNode=1
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1010,619 Selected=0x5D11106F
DockNode ID=0x0000000C Parent=0x00000002 SizeRef=1010,451 Selected=0x66CFB56E
DockNode ID=0x00000004 Parent=0x00000012 SizeRef=368,1200 Split=Y Selected=0xDD6419BC
DockNode ID=0x00000004 Parent=0x00000012 SizeRef=526,1200 Split=Y Selected=0xDD6419BC
DockNode ID=0x00000005 Parent=0x00000004 SizeRef=261,877 Split=Y Selected=0xDD6419BC
DockNode ID=0x00000007 Parent=0x00000005 SizeRef=261,731 Selected=0xDD6419BC
DockNode ID=0x00000007 Parent=0x00000005 SizeRef=261,731 Split=X Selected=0xDD6419BC
DockNode ID=0x00000017 Parent=0x00000007 SizeRef=286,731 Selected=0xDD6419BC
DockNode ID=0x00000018 Parent=0x00000007 SizeRef=238,731 Selected=0xB4CBF21A
DockNode ID=0x00000008 Parent=0x00000005 SizeRef=261,144 Selected=0x1D56B311
DockNode ID=0x00000006 Parent=0x00000004 SizeRef=261,321 Selected=0x8B4EBFA6