1jehuang / 1jehuang/jcode

stdin_request always has an empty prompt and empty tool_call_id; no ask_user tool

Open
#1,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no bug enhancement triage: needs-decision
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.
  • StdinInputRequest carries the originating tool_call_id and the server forwards it.
  • New ask_user tool 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.