Skip to content

Conversation

@jamadeo
Copy link
Collaborator

@jamadeo jamadeo commented May 27, 2025

Only databricks provider to start, but should not be hard to do this for others that support streaming.

Desktop:

streaming-gui.mov

CLI:

cli.mov

}, [headers, body]);

// TODO: not this?
const [, forceUpdate] = useReducer((x) => x + 1, 0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This almost certainly isn't the best way to do this, but without it I could not get new messages to trigger a re-render. I could use a react expert's help here :)

Copy link
Collaborator Author

@jamadeo jamadeo Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zanesq any ideas here? I want to re-render every time we add a chunk, and so far the only thing that made it work was adding this fake state to force it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamadeo I think the best way is to use an immutable approach instead something like this. Instead of mutating in place, always create a new array/object when updating state. React should detect the change and re-render automatically.

Instead of

const lastMessage = currentMessages[currentMessages.length - 1];
lastMessage.content = [...lastMessage.content, ...newMessage.content];
forceUpdate();

try

currentMessages = [
  ...currentMessages.slice(0, -1),
  {
    ...currentMessages[currentMessages.length - 1],
    content: [
      ...currentMessages[currentMessages.length - 1].content,
      ...newMessage.content,
    ],
  },
];

@michaelneale
Copy link
Collaborator

@jamadeo looks really great - but there is a bug where it seems to not call tools correctly
image so may need to chase that down

@jamadeo
Copy link
Collaborator Author

jamadeo commented Jul 3, 2025

Thanks @baxen for the review! I actually effectively reverted the subagent change because it doesn't really help anything to use streaming in that context. If we, in the future, want to show partial text responses from models to subagents in a streamed way we can think about it then, but no reason to fit it in now.

Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@michaelneale
Copy link
Collaborator

michaelneale commented Jul 7, 2025

@jamadeo oops thought it would be an easier merge than that to update it, but looking good. Sorry have slightly broken it (looking at it) - feel free to yank that last merge if it is all broken and not fixed by your morning time.

* main: (23 commits)
  docs: VS Code MCP video (#3307)
  docs: fixed broken link (#3306)
  Add YouTube video to Netlify MCP documentation (#3302)
  docs: add sub-recipes topic (#3241)
  docs: move topics to tutorials section (#3297)
  site analytics (#3293)
  chore(release): release version 1.0.35 (#3292)
  docs: enhanced code editing topic (#3287)
  fix cu (#3291)
  feat: Add environment variables to override model context limits (#3260)
  chore(release): release version 1.0.34 (#3285)
  fix(devcontainer): install protoc to fix build (#3267)
  Enabling npx command to install on Windows Desktop (#3283)
  Fix: Allow native Cmd+Up/Down cursor movement when user has typed text (#3246)
  chore(release): release version 1.0.33 (#3284)
  fix Windows Env Vars (#3282)
  feat: bedrock image content support (#3266)
  Add support in goose configure for streaming http mcp tools (#3256)
  docs: add Alby MCP tutorial (#3217)
  refactor(tests): make logging test in goose-cli less flaky on macos (#3273)
  ...
@michaelneale
Copy link
Collaborator

I think some work still needed:

image

using databricks, when it finishes streaming never goes back to the prompt (even if I press enter)

* main:
  docs: recipe parameters in desktop (#3326)
  switch to custom runner for rust build (#3325)
  fix the npx.cmd mapping issue (#3324)
  Structured output in Goose CLI and Goose Desktop (#3320)
  docs: add managing tools section and tool-router topic (#3310)
  docs: Remove Deeplink for Filesystem MCP Server (#3314)
* main:
  fix: correct tool use for anthropic (#3311)
  fix: resolve hamburger menu breakpoint bug in docs (#3318)
  Recipe library doc (#3329)
@michaelneale
Copy link
Collaborator

have been testing this with CLI + databricks and seems ✅

@jamadeo jamadeo merged commit fde3a57 into main Jul 14, 2025
8 checks passed
@jamadeo jamadeo deleted the jackamadeo/provider-streaming branch July 14, 2025 18:57
atarantino pushed a commit to atarantino/goose that referenced this pull request Jul 14, 2025
Co-authored-by: Michael Neale <[email protected]>
Signed-off-by: Adam Tarantino <[email protected]>
lifeizhou-ap added a commit that referenced this pull request Jul 15, 2025
* main:
  fix: convert invalid recipe variable name to raw content (#3420)
  center goose mobile screenshot (#3418)
  docs: model context limit overrides (#3377)
  docs: Subagents (#3402)
  fix: avoid pass encoded empty string to goose run --recipe (#3361)
  ux: alphabetize extensions (#3416)
  fix: message concatenation in server session management (#3412)
  refactor: streamline memory directory management (#3345)
  feat: Add AZURE_OPENAI_API_KEY as a visible config parameter (#3265)
  feat: stream LLM responses (#2677)
  fix checkout for non mac builds (#3408)
  Docs: Voice dictation in Goose Desktop (#3376)
  docs: cli theme persistence (#3398)
  docs: goose mobile (#3403)
zanesq added a commit that referenced this pull request Jul 15, 2025
* 'main' of github.com:block/goose:
  fix: Set include_usage=true for OpenAI streaming (#3441)
  feat: `recipe list` (#2814) (#2815)
  docs: update github mcp config (#3433)
  feat: Implement streaming for OpenAI (#3413)
  fix: improve extension startup error messages with command details (#2694)
  [feat]: improve file search tools to add globsearch / grep tools (#3368)
  docs: typo in guide description (#3429)
  fix: use safe_truncate to truncate charactor (#3263) (#3264)
  fix: convert invalid recipe variable name to raw content (#3420)
  center goose mobile screenshot (#3418)
  docs: model context limit overrides (#3377)
  docs: Subagents (#3402)
  fix: avoid pass encoded empty string to goose run --recipe (#3361)
  ux: alphabetize extensions (#3416)
  fix: message concatenation in server session management (#3412)
  refactor: streamline memory directory management (#3345)
  feat: Add AZURE_OPENAI_API_KEY as a visible config parameter (#3265)
  feat: stream LLM responses (#2677)

# Conflicts:
#	crates/goose/src/session/storage.rs
#	ui/desktop/src/components/ChatView.tsx
#	ui/desktop/src/components/settings/extensions/subcomponents/ExtensionList.tsx
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
Co-authored-by: Michael Neale <[email protected]>
Signed-off-by: Soroosh <[email protected]>
kwsantiago pushed a commit to kwsantiago/goose that referenced this pull request Jul 19, 2025
Co-authored-by: Michael Neale <[email protected]>
Signed-off-by: Kyle Santiago <[email protected]>
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
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.

5 participants