Skip to content

refactor(agent): architectural decoupling of input suggestion and typing service - #55

Merged
YoungSx merged 1 commit into
mainfrom
feat/input-suggest-arch-optimize
Oct 17, 2026
Merged

YoungSx merged 1 commit into
mainfrom
feat/input-suggest-arch-optimize

Conversation

@YoungSx

@YoungSx YoungSx commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR addresses architectural decoupling and clean code practices around proactive desktop input suggestions and text typing services in Squid.

Key Architectural Improvements

  1. Domain Abstraction for Text Typing ():

    • Extracted interface ().
    • implements this interface, isolating OS-specific subprocess execution (Linux xdotool, macOS osascript, Windows SendKeys).
    • Added support for cooperative cancellation ().
  2. Eliminated Fake Tool Invocation ():

    • In , previously the service invoked .
    • Now invokes directly, eliminating dummy tool call IDs and synthetic contexts.
    • Retained backward-compatible bridge for legacy tool definitions.
  3. Decoupled Pi Extension & Lifecycle ():

    • Extracted interface ().
    • now accepts directly rather than holding a hard dependency on the concrete instance.
  4. Composition Root & Clean DAG Topology:

    • In , dependency construction forms an acyclic DAG:
      TextTypingService -> (InputSuggestionService, createTypeTextTool) -> inputSuggestionExtension.
  5. Defensive Error Handling:

    • In , added try/catch guards to guarantee that custom executors never produce unhandled promise rejections inside the agent turn.

Verification

  • Subagent Code Review: Conducted independent review with dedicated subagent; received full Approval & Sign-off.
  • Type Checking: bun run typecheck passed with 0 errors across project and test configs.
  • Unit Tests: Full test suite passes.
  • Visual Smoke Test: xvfb-run -a -s "-screen 0 1280x1024x24" bun run ui:smoke passed with full interactive confirmation flow.

…cture

1. Decoupled TextTypingExecutor domain interface from concrete TextTypingService.
2. Eliminated fake ToolDefinition.execute calls and dummy contexts in InputSuggestionService.
3. Decoupled inputSuggestionExtension to accept pure typeTextTool and Resettable lifecycle.
4. Cleaned up watch-session composition root into a strict acyclic DAG topology.
5. Handled tool abortion and typing errors defensively.
6. Expanded unit test suite and passed visual smoke tests.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T12:19:08.878067Z eb739e9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@YoungSx
YoungSx merged commit ab8eae7 into main Oct 17, 2026
3 checks passed
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