Conversation
📝 WalkthroughWalkthroughAdds an Autonomous Tutor feature: DTOs, a pipeline implementation with prompt/template and tool orchestration, a variant, shared discussion formatting util, web endpoints and callbacks, and status update extensions to carry confidence and posting metadata. Changes
Sequence DiagramsequenceDiagram
participant Client as Client
participant Router as HTTP Router
participant Worker as Background Worker
participant Pipeline as AutonomousTutorPipeline
participant Agent as Agent Executor
participant Tools as Tool Orchestrator
participant Status as Status Callback
Client->>Router: POST /autonomous-tutor/run (DTO, variant)
Router->>Router: Validate DTO & variant
Router->>Worker: Spawn background execution
Worker->>Pipeline: start(dto, variant, callback)
Pipeline->>Pipeline: build_system_message(dto, state)
Pipeline->>Tools: get_tools(state)
Tools-->>Pipeline: tool callables (lecture/FAQ/exercise, course details)
Pipeline->>Agent: Execute agent (system prompt + tools + discussion)
Agent->>Tools: invoke tools as needed
Tools-->>Agent: return tool results
Agent-->>Pipeline: agent response
Pipeline->>Pipeline: post_agent_hook(response)
Pipeline->>Pipeline: _estimate_confidence(response)
Pipeline->>Status: done(result, confidence, should_post_directly)
Status-->>Client: status updates (via callbacks/webhooks)
Worker-->>Router: completion logged
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Pylint (4.0.4)iris/src/iris/web/status/status_update.pyiris/src/iris/pipeline/autonomous_tutor_pipeline.pyThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@iris/src/iris/pipeline/autonomous_tutor_pipeline.py`:
- Around line 203-244: The placeholder _estimate_confidence always returns 0.99
which permanently sets should_post_directly true; change _estimate_confidence in
AutonomousTutorPipeline (or wiring around post_agent_hook) to return a
conservative default (e.g., 0.75) or read a configurable default (env/config
flag) so outputs fall into verification by default until a real estimator
exists; update any references to DIRECT_POST_CONFIDENCE_THRESHOLD usage if
needed and add a short debug/warning log in _estimate_confidence indicating the
value is a conservative placeholder.
In `@iris/src/iris/pipeline/prompts/templates/autonomous_tutor_system_prompt.j2`:
- Around line 53-56: In the conditional block controlled by allow_faq_tool in
autonomous_tutor_system_prompt.j2, fix the minor punctuation typo by removing
the extra period at the end of the second sentence ("Respond concisely using the
most relevant FAQ, and only if no other tool fits..") so it ends with a single
period; update the template text within the allow_faq_tool branch accordingly.
In `@iris/src/iris/web/status/status_update.py`:
- Around line 163-166: The code unconditionally assigns should_post_directly to
self.status which can set a non-optional bool to None; update the assignment in
the method that uses self.status (status_update.py) so you only set
self.status.should_post_directly when the caller provided a value (e.g., check
should_post_directly is not None before assigning) while still keeping the
hasattr(self.status, "should_post_directly") guard; make the same conditional
assignment pattern for confidence if needed (check confidence is not None before
assigning to self.status.confidence).
🧹 Nitpick comments (1)
iris/src/iris/domain/variant/autonomous_tutor_variant.py (1)
21-22: Optional: drop redundantrequired_modelsoverride.
AbstractAgentVariant.required_models()already returns{self.agent_model}, so this override is duplicative.♻️ Suggested cleanup
- def required_models(self) -> set[str]: - return {self.agent_model}
iris/src/iris/pipeline/prompts/templates/autonomous_tutor_system_prompt.j2
Outdated
Show resolved
Hide resolved
…:ls1intum/edutelligence into iris/feature/enable-autonomous-responses
florian-glombik
left a comment
There was a problem hiding this comment.
Change requests
- Fix the DTO naming inconsistency
- Define constant as variable
Other comments
Other comments might not need a change
| has_discussion = post.answers and len(post.answers) > 0 | ||
|
|
||
| template_context = { | ||
| "current_date": datetime.now(tz=pytz.UTC).strftime("%Y-%m-%d %H:%M:%S"), |
There was a problem hiding this comment.
We have the timeformatting at multiple places in the code, could we define it as one shared constant instead across the iris code?
| # TODO: Extract confidence from model output or implement confidence estimation | ||
| # For now, use a placeholder confidence value | ||
| confidence = self._estimate_confidence(state) | ||
| should_post_directly = confidence >= self.DIRECT_POST_CONFIDENCE_THRESHOLD |
There was a problem hiding this comment.
This is a TODO for a future PR? Could we link the respective issue then (e.g. on linear)
| variant_id="default", | ||
| name="Default", | ||
| description="Default autonomous tutor variant using the OpenAI GPT-OSS 20B model.", | ||
| agent_model="gpt-oss:20b", |
There was a problem hiding this comment.
Is it really intended to hardcode the model? Shouldn't we make this configurable?
| stage = len(stages) | ||
| stages += [ | ||
| StageDTO( | ||
| weight=30, |
There was a problem hiding this comment.
Can we define the 30 as constant and describe why we choose 30 and not some other value?
| from iris.domain.pipeline_execution_dto import PipelineExecutionDTO | ||
|
|
||
|
|
||
| class AutonomousTutorPipelineExecutionDto(PipelineExecutionDTO): |
There was a problem hiding this comment.
We usually capatalize DTO
| class AutonomousTutorPipelineExecutionDto(PipelineExecutionDTO): | |
| class AutonomousTutorPipelineExecutionDTO(PipelineExecutionDTO): |
Summary
This PR introduces the Autonomous Tutor Pipeline, a new pipeline that enables Iris to autonomously respond to student posts in course channels without requiring a human tutor in the loop. The pipeline analyzes student questions and generates helpful, pedagogically sound responses based on available course context (exercises, lectures, FAQs).
Testing the Autonomous Tutor Pipeline
Note: The endpoint returns
202 Acceptedimmediately.The actual response is logged and would normally be sent to Artemis via callback.
Summary by CodeRabbit
Release Notes
New Features
Refactoring
✏️ Tip: You can customize this high-level summary in your review settings.
Summary by CodeRabbit
New Features
Refactor