Skip to content

[Feature and Refactor] Refactor the core-loop and TUI#14

Merged
wangxingjun778 merged 17 commits into
mainfrom
feat/core_loop
Jul 13, 2026
Merged

[Feature and Refactor] Refactor the core-loop and TUI#14
wangxingjun778 merged 17 commits into
mainfrom
feat/core_loop

Conversation

@wangxingjun778

@wangxingjun778 wangxingjun778 commented Jul 13, 2026

Copy link
Copy Markdown
Member

LeapFlow Runtime Enhancements

⚙️ Core Runtime & Context Governance

  • Adaptive Context Governance: Introduces the ContextGovernanceController to dynamically manage and enforce exploration limits.
  • Progressive Context Disclosure: Adds a DisclosurePlanner to progressively reveal tool schemas and memory states as needed, optimizing token usage and focus.
  • Unified Action Approval Framework: Implements the ApprovalOrchestrator to coordinate structured approvals (e.g., shell commands, file writes) seamlessly across both in-process and daemon-backed sessions.

💻 TUI & User Experience

  • Native Approval UI: Integrated a native ApprovalModal directly into the TUI for smoother, safer interaction loops.
  • Robust Session Management: Introduced a reconnectable _DaemonRuntimeBridge to ensure persistent connectivity with background sessions.
  • Enhanced Command Queueing: Added comprehensive runtime controls, introducing supporting commands: /cancel, /skip, /pause, /resume, /queue, and /drop.
  • Paste Optimization: Added safe paste compaction to handle large clipboard inputs gracefully without disrupting the terminal layout.

🌐 Gateway & Integration Refactoring

  • Lightweight Gateway Adapters: Refactored built-in communication channels—including DingTalk, Feishu, Telegram, Webhook, and the core API Server—to utilize dependency-free, lightweight HTTP helpers, significantly reducing external overhead.

🧹 Deprecations & Cleanups

  • Shortcut Optimization: Removed user-customizable shortcuts to streamline the input handling engine and improve internal maintainability.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces adaptive context governance, progressive context disclosure, and a unified action approval framework to the LeapFlow runtime. Key updates include the addition of a DisclosurePlanner to progressively disclose tool schemas and memory, a ContextGovernanceController to manage exploration limits, and an ApprovalOrchestrator to coordinate structured action approvals (such as shell commands and file writes) across both in-process and daemon-backed sessions. The TUI has been significantly enhanced with a native ApprovalModal, a reconnectable _DaemonRuntimeBridge, safe paste compaction, and improved command queueing (supporting /cancel, /skip, /pause, /resume, /queue, and /drop). Additionally, built-in gateway adapters (DingTalk, Feishu, Telegram, Webhook, API Server) were refactored to use lightweight, dependency-free HTTP helpers, and user-customizable shortcuts were removed. I have reviewed the changes and have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Root cause: the modal's height budget calculation went negative when
there were 6 choices (fixed_count=13 > min_height=10), causing
_preserve_frame_and_choices to slice out all middle content.

Fix:
- Remove complex height-based truncation from ApprovalModal.fragments()
- Use static content caps (_DETAIL_LINES=3, _REASON_LINES=2) instead
- Let the prompt_toolkit Window handle clipping via dont_extend_height
- Add line_count() for dynamic Window height sizing
- Add bottom=2 to Float constraint to prevent status bar overlap
- All content sections now always render: summary, detail, reason,
  keyboard hints, and all choice options

Co-authored-by: Cursor <cursoragent@cursor.com>
@wangxingjun778 wangxingjun778 merged commit ed5f1b8 into main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant