mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-25 01:20:11 +08:00
fix(browser): show resolved variables in workflow run log input (#15325)
### What problem does this PR solve? Browser parsed sys.query from prompts but never called set_input_value, so node_finished inputs displayed null in the agent orchestration run log. Additionally, Browser’s tenant-model path could trigger unsupported structured-output modes (response_format/tool_choice) for some OpenAI-compatible providers (notably DeepSeek thinking models), causing step failures. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -53,9 +53,13 @@ class _FakeCanvas:
|
||||
self._refs = refs or {}
|
||||
|
||||
def is_reff(self, token):
|
||||
return token in self._refs
|
||||
key = token.strip("{} ")
|
||||
return key in self._refs or token in self._refs
|
||||
|
||||
def get_variable_value(self, token):
|
||||
key = token.strip("{} ")
|
||||
if key in self._refs:
|
||||
return self._refs[key]
|
||||
return self._refs[token]
|
||||
|
||||
def get_tenant_id(self):
|
||||
@@ -69,6 +73,19 @@ def _build_component():
|
||||
return component
|
||||
|
||||
|
||||
def test_prepare_input_values_records_variable_inputs():
|
||||
component = browser_use_module.Browser.__new__(browser_use_module.Browser)
|
||||
component._canvas = _FakeCanvas(refs={"sys.query": "open example.com"})
|
||||
component._param = browser_use_module.BrowserParam()
|
||||
component._param.prompts = "{sys.query}"
|
||||
component._param.inputs = {}
|
||||
|
||||
component._prepare_input_values()
|
||||
|
||||
assert component.get_input_value("sys.query") == "open example.com"
|
||||
assert component.get_input_values()["sys.query"] == "open example.com"
|
||||
|
||||
|
||||
def test_extract_ids_supports_mixed_literals_and_variables():
|
||||
component = browser_use_module.Browser.__new__(browser_use_module.Browser)
|
||||
component._canvas = _FakeCanvas(
|
||||
|
||||
Reference in New Issue
Block a user