Skip to content

feat(cloud-agent): prompt autocomplete (ghost text)#2120

Draft
markijbema wants to merge 1 commit intomainfrom
mark/cloud-agent-chat-autocomplete-monorepo
Draft

feat(cloud-agent): prompt autocomplete (ghost text)#2120
markijbema wants to merge 1 commit intomainfrom
mark/cloud-agent-chat-autocomplete-monorepo

Conversation

@markijbema
Copy link
Copy Markdown
Contributor

Summary

Recreates PR #5 by @markijbema on the monorepo main, as requested by @jeanduplessis.

  • Adds cloudAgent.getFimAutocomplete tRPC mutation backed by Mistral Codestral FIM endpoint
  • Adds useChatGhostText hook in cloud-agent-next with debounced completion requests and stale-request guard
  • Adds ghost text overlay rendering in cloud-agent-next/ChatInput; accept with Tab (full), ArrowRight (next word), or dismiss with Escape
  • Improves sendProxiedChatCompletion error handling to catch network failures and JSON parse errors gracefully

Verification

  • TypeScript typecheck passes (tsgo --noEmit -p apps/web/tsconfig.json)
  • Format check passes (oxfmt)

Visual Changes

N/A (ghost text overlay is invisible until a suggestion is returned)

Reviewer Notes

  • The getFimAutocomplete endpoint uses generateApiToken with internalApiUse: true to bypass abuse heuristics, consistent with the original PR's intent
  • The hook targets trpc.cloudAgent.getFimAutocomplete (not cloudAgentNext) since the FIM endpoint is user-scoped, not session-scoped
  • Files moved from src/components/cloud-agent/apps/web/src/components/cloud-agent-next/ and src/routers/apps/web/src/routers/ per monorepo structure

Closes #5

Implements ghost-text prompt autocomplete for the Cloud Agent chat input
(based on original PR #5 by @markijbema, rebased on monorepo main).

- Adds `cloudAgent.getFimAutocomplete` tRPC mutation using Mistral Codestral FIM
- Adds `useChatGhostText` hook with debounced completion requests
- Adds ghost text overlay rendering in `cloud-agent-next` ChatInput
- Accept suggestion: Tab (all), ArrowRight (next word), Escape clears
- Improves error handling in `sendProxiedChatCompletion`
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

This Pull Request has been inactive for 30 days and will be closed in 7 days if no further activity occurs. Please update or close this PR if it is no longer relevant.

@github-actions github-actions Bot added the stale label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant