Skip to content

feat(input-suggest): proactive input suggestions & typing via official Pi Agent API - #54

Merged
YoungSx merged 2 commits into
mainfrom
feat/input-suggest-trigger
Oct 17, 2026
Merged

YoungSx merged 2 commits into
mainfrom
feat/input-suggest-trigger

Conversation

@YoungSx

@YoungSx YoungSx commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the proactive input suggestion feature with desktop confirmation, automated text typing, GUI controls, and alignment with official @earendil-works/pi-coding-agent APIs and patterns.

Key Changes

  1. Official Pi Agent Tool (type_text):
    • Implemented src/type-text-tool.ts using defineTool and TypeBox typeTextParams.
    • Supports AbortSignal cancellation and structured AgentToolResult<TypeTextToolDetails>.
  2. Official Pi InlineExtension:
    • Implemented src/input-suggestion-extension.ts conforming to Pi's InlineExtension interface.
    • Registers type_text via pi.registerTool(...) and cleans up debounce states on session_shutdown.
  3. Turn Action Tracking:
    • Added "type_text" into ACTING_TOOL_NAMES in src/resident-agent.ts so world-altering keyboard typing counts as an action (acted() = true).
  4. Unified Action Execution Pipeline:
    • Refactored src/input-suggestion.ts to execute text typing via the official ToolDefinition.execute(...) pipeline when the user confirms with "Allow".
  5. Driver Mechanism (Retained):
    • Kept the current event.kind === "focus_changed" event triggering mechanism in src/watch-session.ts as explicitly requested.
  6. GUI Controls & Configuration:
    • Added inputSuggestions toggle in ui/settings.slint, src/config-schema.ts, and src/config-service.ts (defaults to true).

Verification & Testing

  • Unit tests: tests/type-text-tool.test.ts, tests/input-suggestion-extension.test.ts, tests/input-suggestion.test.ts, tests/text-typing-service.test.ts, tests/resident-agent.test.ts.
  • Type checking: bun run typecheck (0 errors).
  • Test suite: bun test (840 pass, 7 skip, 0 fail).
  • Visual smoke test: bun run ui:smoke on X11/Xvfb virtual desktop passed with screenshots verified.

- Proactively trigger suggestions when focus moves to text inputs, editors, or terminals
- Predict relevant text input and present confirmation prompt via ConfirmationCard
- Auto-type accepted text into active window via cross-platform TextTypingService
- Add GUI toggle in Settings (Screen group: inputSuggestions on/off, default on)
- Support instant live hot reload via applies: 'now' in ConfigService
- Full test coverage and virtual desktop visual smoke test verified
@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-17T07:47:03.823299Z a4027a1 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 changed the title feat: add proactive input suggestions with auto-typing and GUI toggle feat(input-suggest): proactive input suggestions & typing via official Pi Agent API Oct 17, 2026
@YoungSx
YoungSx merged commit d41ef08 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