stdin_request always has an empty prompt and empty tool_call_id; no ask_user tool
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Every stdin_request reaches clients with prompt: String::new() and tool_call_id: \"\" (hardcoded in bash.rs and again in the server forwarder in client_lifecycle.rs), so a GUI can only render a bare 'tool requests input' field. The wire struct documents the prompt as 'the last line(s) of output (e.g. "Password: ")' but it is never populated. Related: models keep inventing AskUserQuestion/ask_question and hitting Unknown tool because there is no way to ask the user anything mid-turn.
Fix implemented on https://github.com/dpfurners/jcode/tree/stdin-prompt-context (single commit, tests included):
- bash keeps a bounded tail of recent output (raw chunk reads, since an interactive prompt has no trailing newline) and sends the last non-blank lines as the prompt; password-shaped final lines set
is_password. StdinInputRequestcarries the originatingtool_call_idand the server forwards it.- New
ask_usertool bridging onto the existing stdin_request/stdin_response transport (10-min timeout, masked answers not echoed, headless contexts fail fast).
I could not open a PR (CreatePullRequest denied for this account despite a linked fork; possibly repo interaction limits). Happy to PR it if you enable that, or feel free to cherry-pick: git pull https://github.com/dpfurners/jcode stdin-prompt-context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with bash.rs and client_lifecycle.rs, then trace the existing stdin_request/stdin_response transport and wire struct. Review the stdin-prompt-context branch and run its included tests. Done means prompts and tool_call_id reach clients correctly, password prompts are identified, and ask_user works through the transport without breaking headless contexts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100