Skip to content

fix: Unable to create scheduled tasks - #3780

Merged
Dallas98 merged 1 commit into
developfrom
fix/auto-task
Aug 26, 2026
Merged

fix: Unable to create scheduled tasks#3780
Dallas98 merged 1 commit into
developfrom
fix/auto-task

Conversation

@Dallas98

@Dallas98 Dallas98 commented Aug 26, 2026

Copy link
Copy Markdown
Member

before:

image image

after:

image

Copilot AI lite review requested due to automatic review settings August 26, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes scheduled-task creation failures by hardening how agent outputs and user messages are interpreted in the automation flow, and by ensuring LLM calls are wired with an observer.

Changes:

  • Prevents misclassifying explicit “Final answer / 最终回答” outputs as incomplete action/tool preambles.
  • Strips runtime-injected [Current time: ...] headers from the persisted user message before language detection and proposal creation.
  • Passes a MessageObserver into automation LLM calls and updates tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/nexent/core/agents/core_agent.py Adds explicit final-answer detection to avoid false “incomplete action” classification.
backend/services/agent_automation/tool_adapter.py Strips runtime time header before language detection and proposal request creation.
backend/services/agent_automation/prompt_generator.py Injects MessageObserver into the automation prompt-generation LLM model.
backend/services/agent_automation/intent_analyzer.py Injects MessageObserver into the automation intent-analysis LLM model.
test/sdk/core/agents/test_core_agent.py Adds regression coverage for explicit final-answer outputs.
test/backend/services/test_agent_automation_tool_adapter.py Adds coverage for stripping runtime time headers and updates adapter expectations.
test/backend/services/test_agent_automation_prompt_generator.py Asserts observer is provided to the LLM model config.
test/backend/services/test_agent_automation_intent_analyzer.py Captures LLM model config to assert observer is provided.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +40 to +44
if normalized.startswith("[Current time:"):
close_index = normalized.find("]", len("[Current time:"))
if close_index >= 0:
return normalized[close_index + 1:].lstrip("\n").strip()
return normalized
Comment on lines 236 to 238
llm = OpenAIModel(
observer=MessageObserver(),
model_id=get_model_name_from_config(self._model_config) if self._model_config.get("model_name") else "",
Comment on lines 292 to 294
llm = OpenAIModel(
observer=MessageObserver(),
model_id=get_model_name_from_config(self._model_config),
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/services/agent_automation/tool_adapter.py 88.88% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Dallas98
Dallas98 merged commit 42ce05f into develop Aug 26, 2026
14 checks passed
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.

2 participants