Repository navigation
Description
Problem
Some agent tasks require an interactive shell login where the user must enter a password personally. A concrete example is ssh user@host: the agent can prepare the connection, but the user needs to complete authentication before work can continue inside that remote shell.
The desired experience is to stay in the current Maka conversation: the agent explicitly opens the relevant terminal in the side panel, the user enters the password there, and the agent continues in that same authenticated terminal after the user confirms completion.
Copying a command into an unrelated external terminal breaks this continuity. Supplying the password in chat or as a model-authored tool argument is not an acceptable workaround.
This request focuses on password-based interactive login. Other interactive terminal workflows may benefit later, but are not required to justify this feature.
Desired outcome
User journey
- The agent explains why an interactive login is needed, identifies the target, and requests the existing command permissions.
- The agent explicitly opens or reveals the exact terminal running the login command in the conversation's side panel.
- The agent requests a human handoff. The UI makes clear which terminal is awaiting input, which host/process it belongs to, and that the agent is paused from writing to it.
- The user enters the password directly in the terminal. The password is not supplied through chat or an agent tool call.
- After completing authentication, the user explicitly confirms that the agent may continue, through a Resume action or an equivalent explicit chat confirmation bound to this handoff.
- The agent observes the appropriate post-handoff output and continues in the same live terminal. For SSH, subsequent input goes to the existing remote shell, preserving its connection, current directory, and shell environment.
User confirmation authorizes resumption; it is not proof that authentication succeeded. If login failed or the process exited, the agent must report the actual state instead of claiming success.
First-slice requirements
- Give the agent a supported way to request that the relevant live terminal be shown and handed to the user. Reuse Maka's existing terminal surface and runtime-owned process lifecycle. This is a capability requirement, not a decision to add a standalone tool.
- Bind handoff and resumption to the same conversation, execution host, and terminal resource. Never silently create a replacement shell or replay the login command.
- While the user owns input, prevent agent writes to that terminal, including previously queued writes that could race with password entry. Other unrelated tasks need not be paused.
- Wait for explicit user confirmation. Automatic password-prompt detection or automatic recognition of login success is not required.
- Preserve existing permissions and sandbox boundaries. Opening a terminal, completing authentication, or clicking Resume does not grant unrestricted permission for later commands.
- Provide a clear cancel/stop path. A closed terminal, exited process, or lost connection must not be treated as a completed login or silently re-created. Recovery must validate the original live resource before resumption.
Interface and availability remain design questions
The agent needs to discover and invoke this capability when relevant, but that does not imply a permanently exposed tool on every model request.
Evaluate the smallest fit with Maka's existing interfaces: an operation on an existing terminal capability, a runtime interaction request, or an on-demand discovered tool. Do not commit to a new tool name, separate tool family, or additional lifecycle owner in this issue.
Availability should reflect the actual environment. An interactive desktop session with a reachable terminal surface and human-input path may support handoff; an unattended/headless run must not advertise or invoke a handoff it cannot fulfill. Permissions must still be checked at invocation, even if the capability was discovered earlier.
If exposure is conditional or on demand, the agent must still have a reliable way to discover the capability before needing to request a password. Define what makes it discoverable, when its invocation becomes available, and how a vanished UI/client is reported. Automatic prompt detection is not a prerequisite for discovery.
Before implementation, resolve:
- Which existing interface should own the request, and is any new tool necessary?
- When should the capability be advertised or discovered, and what happens when no interactive user surface is available?
- How does explicit user completion resume the correct waiting operation without creating a second process or competing state owner?
Password and recording boundary
Human-entered secrets must not become model-authored WriteStdin arguments or enter Maka's conversation history, tool/replay records, diagnostic logs, telemetry, or model requests. The raw input must reach the intended process through a human-input path with explicitly defined recording behavior.
Disabling terminal echo alone does not establish this guarantee. Implementation must also account for rendered output, scrollback, snapshots, and reconnect/replay paths. Sensitive handoff content must not become model-visible or durable merely because control returns to the agent.
This is a requirement on Maka's handling of the data, not a claim that Maka can prevent the destination program or remote host from receiving or recording credentials. The user must be able to identify the destination before typing.
Acceptance criteria
- A real desktop terminal integration test demonstrates login command -> visible terminal -> human input -> explicit Resume -> agent continuation in the same live shell.
- The test proves process/session continuity, including a shell-local marker and working directory that remain available after handoff.
- Agent writes cannot interleave with human authentication input, and stale or duplicate resume actions cannot resume another terminal or submit duplicate commands.
- A synthetic secret is absent from model requests, tool arguments/results, durable events/replay, logs, telemetry, and retained terminal projections. Include both normal no-echo input and an echoing test fixture to verify the chosen sensitive-output policy.
- Failed authentication, cancellation, process exit, and disconnect/reconnect have explicit outcomes without automatic command replay or claims of success.
- Existing command approval and execution-host boundaries remain effective after authentication.
- The agent can discover the capability in a supported interactive session; unsupported or no-longer-connected environments produce an actionable outcome without pretending a terminal was shown. The feature does not require permanently exposing a new tool in every session.
- Desktop screenshots show the normal terminal, waiting-for-user state, and resumed state at matching viewport and content conditions.
Alternatives or workarounds
- User logs in through an external terminal: workable manually, but the agent cannot simply continue in that terminal without an explicit attachment mechanism.
- SSH keys or existing credential helpers: useful where available, but do not cover environments that require a user-entered password.
- Paste the password into chat or let the model send it through a tool: not an acceptable substitute for human input.
Related work and inspiration
- feat(runtime): RFC - interactive PTY and stdin for background Bash #775 established the interactive PTY/stdin direction and explicitly distinguished model-authored
WriteStdinfrom a safe password-entry channel. This issue requests the human-facing handoff and continuation contract on top of terminal capabilities. - [Tracking] Runtime Host remote access and production hardening #2522 covers remote Runtime Host access, including SSH onboarding. Logging into a shell inside an agent task is a separate user journey; it does not require registering or installing a new Runtime Host.
- Inspired by using the GitHub Copilot desktop app's visible terminal workflow. Its public changelog describes reading rendered terminal output and agent access to user-opened terminals. This reference is inspiration for shared terminal interaction, not evidence of Copilot's password isolation or automatic handoff guarantees.
The initial product scope has been confirmed: user-entered password, explicit handoff completion, and agent continuation in the same terminal. Exact UI, interface ownership, capability discovery/exposure, and sensitive-output handling should be resolved during design before implementation.
Activity
testikun commentedon Sep 17, 2026
take
testikun commentedon Sep 17, 2026
@hqhq1025 Before implementation, I'd like to discuss a compact input card bound to the original terminal as the primary way for the user to provide a password or other input.
I think this would offer a better experience for users unfamiliar with terminals. The agent can prepare the command, explain the purpose, and identify the target; the user sees one concrete question, enters the requested information, and presses Enter. For
ssh [email protected], that means asking for the password for that account, without requiring the user to understand SSH syntax, terminal focus, or why password typing produces no visible characters. A familiar masked field also makes the input destination clearer than a general chat box.The longer-term benefit is a reusable interaction that is not tied to one command. A passphrase, verification code, retry, or another line of terminal input could use the same compact surface and request lifecycle. It could also support input needed later in an existing shell, such as a remote sudo prompt or an interactive client. This gives us a path to broader coverage without adding a separate UI for each program. The initial delivery would still focus on this issue's password-login journey; each additional workflow needs validation, and a reusable card does not imply automatic understanding of every terminal prompt.
SSH would still run in the original Runtime-owned PTY. The proposal changes the human input surface, not the connection or shell lifecycle. The original terminal remains available in the side panel for context and more complex interaction. The sketch below explores a compact default view with terminal details behind “View terminal”; automatically revealing that exact terminal, as the issue currently requires, can be retained if preferred.
The image is a UI sketch, not an implemented feature. Its intended flow is: enter the requested value → submit it to the terminal → continue entering any further responses, or explicitly choose “Let the agent continue.”
At a high level, I would build this on the existing Runtime-owned PTY, resource controller, and interaction lifecycle:
WriteStdincall. Only non-sensitive submission and lifecycle status is recorded or exposed to the model.The capability would be available only with a reachable interactive surface and would be rechecked at invocation. This proposal would not depend on an installed SSH askpass helper or require a new permanently exposed tool family or process owner.
The card does not by itself solve output privacy. Before implementation, the detailed design still needs to settle how echoed or delayed sensitive output, scrollback, snapshots, and replay remain protected while providing usable post-handoff observations. Neither a masked field nor clicking Resume would be treated as sufficient to make terminal content safe for the model.
Would you accept this input-card approach as an adjustment to the issue's direct-terminal-input journey? If this isn't the direction you'd like, I'll return to the original terminal-handoff approach described in the issue and discuss a revised detailed design with you before implementing.