Skip to content

adding a write result tool - #399

Closed
DhavalRepo18 wants to merge 796 commits into
mainfrom
write_db_result
Closed

adding a write result tool#399
DhavalRepo18 wants to merge 796 commits into
mainfrom
write_db_result

Conversation

@DhavalRepo18

Copy link
Copy Markdown
Collaborator

issue #395

ShuxinLin and others added 30 commits April 1, 2026 15:14
The LLM was guessing argument names (e.g. 'site' instead of 'site_name',
'asset_name' instead of 'asset_id') because the prompt gave no schema.

execute_plan now pre-fetches tool schemas for all referenced servers
(one _list_tools call per server, reusing the MCP connection), then
passes each tool's parameter signature to execute_step -> _resolve_args_with_llm.
The prompt instructs the LLM to use EXACTLY the listed parameter names.

New tests: schema appears in prompt, empty schema renders as '(unknown)'.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
_parse_json returned {} for both "parsed empty object" and "parse failure",
so the warning in _resolve_args_with_llm fired for tools like
current_date_time that legitimately take no arguments.

_parse_json now returns None on failure; {} is a valid successful result.
The warning only triggers on None, and the caller returns {} as fallback.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
assets/sensors/history now include the actual values in their message
field so downstream steps (and the LLM) have the data inline without
having to parse the full response object.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
The planner's server description format is "tool(param: type): desc".
The LLM sometimes echoes the full signature in #Tool lines, e.g.
"#Tool2: assets(site_name: string)", which caused MCP to warn "tool not
listed" and skip validation.  parse_plan now splits on "(" and keeps
only the bare tool name.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
- Move src/workflow/ → src/agent/
- Update all internal imports (from workflow.* → from agent.*)
- Update patch targets in tests (workflow.executor.* → agent.executor.*)
- Update pyproject.toml: packages list and plan-execute entry point
- Update INSTRUCTIONS.md and CLAUDE.md references

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
AgentRunner defines the common interface (run method + llm attribute)
that all future agent implementations must satisfy. PlanExecuteRunner
now inherits from it and calls super().__init__(llm).

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Move executor, planner, runner, and models (Plan, PlanStep, StepResult)
into src/agent/plan_execute/. AgentRunner ABC and OrchestratorResult
remain in src/agent/ as the shared orchestration contract. Update all
imports and patch targets in tests accordingly.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
fix: strip tool signature suffix copied by LLM from server descriptions
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…ays"

This reverts commit 8e125b8.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…low-to-agent

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
… mode list

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
chore: add stale bot to auto-close inactive issues
Closes #244

- Add `src/agent/claude_agent/` subpackage with `ClaudeAgentRunner`
  that implements `AgentRunner` via the claude-agent-sdk agentic loop
- Wire the same IoT/FMSR/TSFM/utilities/WO MCP servers as stdio
  servers via `ClaudeAgentOptions.mcp_servers`
- Add `claude-agent` CLI entry point (`agent.claude_agent.cli:main`)
- Add `claude-agent-sdk>=0.0.14` to project dependencies
- Export `ClaudeAgentRunner` from `agent.__init__`
- Add 7 unit tests (all pass, no real API calls)

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…_execute/models

- Delete src/agent/models.py
- Add AgentResult to src/agent/plan_execute/models.py alongside Plan/PlanStep/StepResult
- Update AgentRunner ABC and all subclasses to use AgentResult
- Export AgentResult from agent.__init__

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…stratorResult for plan-execute

- src/agent/models.py: AgentResult(question, answer, history: Any)
  — thin base result for all AgentRunner subclasses; history type TBD
- src/agent/plan_execute/models.py: OrchestratorResult(question, answer, plan, history: list[StepResult])
  — kept for PlanExecuteRunner with full plan/step-result detail
- ClaudeAgentRunner.run() returns AgentResult(history=None)
- AgentRunner ABC return type is AgentResult

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…OPIC_BASE_URL

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
…tellm_proxy/ model ID

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
TokenRouter-AI and others added 25 commits June 17, 2026 17:15
Signed-off-by: TokenRouter <support@tokenrouter.com>
…cture-support

docs: add TokenRouter infrastructure support acknowledgment
Expose failure_code through both the update_workorder core function and the
MCP tool wrapper, and cover partial-update behavior in the lifecycle test.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Dhaval Patel <pateldha@us.ibm.com>
feat(wo): support failure_code in update_workorder
Signed-off-by: ulises-jeremias <ulisescf.24@gmail.com>
Signed-off-by: Parman Mohammadalizadeh <prmma23@gmail.com>
…uide

docs(contrib): add external industrial dataset mappings
Signed-off-by: Chathurangi Shyalika <chathurangishyalika@Chathurangis-MacBook-Pro.local>
Signed-off-by: Chathurangi Shyalika <chathurangishyalika@Chathurangis-MacBook-Pro.local>
Signed-off-by: Chathurangi Shyalika <chathurangishyalika@Chathurangis-MacBook-Pro.local>
Signed-off-by: Chathurangi Shyalika <chathurangishyalika@Chathurangis-MacBook-Pro.local>
feat(benchmark): add scenario suite runner
Signed-off-by: Chathurangi Shyalika <chathurangishyalika@daniels-mbp.watson.ibm.com>
Signed-off-by: Dhaval Patel <pateldha@us.ibm.com>
Signed-off-by: Dhaval Patel <pateldha@us.ibm.com>
@DhavalRepo18

Copy link
Copy Markdown
Collaborator Author

As discussed, I am enabling this write result tool. We will learn how to mention this in the System Prompt, and it should enforce it.

Signed-off-by: Dhaval Patel <pateldha@us.ibm.com>
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.