Task Creation Enhancement: Support for ContextWindow (or userMessage)#84
Conversation
|
I can hear dex providing feedback to me already, so before this is out of draft state, I will:
|
There was a problem hiding this comment.
❌ Changes requested. Reviewed everything up to 7e63816 in 2 minutes and 37 seconds
More details
- Looked at
724lines of code in14files - Skipped
0files when reviewing. - Skipped posting
9drafted comments based on config settings.
1. acp/test/utils/task.go:15
- Draft comment:
TestTask now supports both userMessage and contextWindow. Make sure tests cover the case when only one is set. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%
None
2. acp/internal/controller/task/task_controller.go:192
- Draft comment:
When prepending the system message in prepareForLLM, consider verifying that agent.Spec.System is non-empty. An empty system message might lead to an uninformative context window. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
While the suggestion seems reasonable at first glance, there are several factors to consider: 1) The agent was already validated earlier in validateTaskAndAgent 2) If agent validation is required, it should be done at the agent level, not here 3) An empty system message, while not ideal, won't break anything 4) The comment is speculative ("might lead to") rather than pointing out a definite issue.
I might be wrong about agent validation - I don't actually see where agent.Spec.System is validated. And an empty system message could potentially cause issues with some LLM providers.
However, this is still a speculative comment about a hypothetical issue. If system message validation is needed, it should be handled at the agent level or in the validation package, not here. This function's responsibility is just to prepare the context window.
The comment should be deleted because it's speculative and suggests validation that belongs elsewhere in the codebase if needed.
3. acp/internal/server/server.go:169
- Draft comment:
Good job validating input using ValidateTaskMessageInput. Consider logging the error details before returning so that troubleshooting API input issues is easier. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%
None
4. acp/test/utils/task.go:23
- Draft comment:
The helper functions for setting up and tearing down test tasks are clear. Ensure that any future updates to task spec fields are mirrored here to keep test utilities in sync. - Reason this comment was not posted:
Confidence changes required:10%<= threshold50%
None
5. acp/internal/controller/task/task_controller.go:174
- Draft comment:
The revised prepareForLLM function cleanly handles 'userMessage' vs 'contextWindow'. The use of GetUserMessagePreview to set a preview is good; ensure that any edge cases (e.g., very long messages) are covered in tests. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%
None
6. acp/README.md:26
- Draft comment:
Consider changing 'permission' to 'permissions' in the sentence "Make sure you have the proper permission to the registry if the above commands don’t work." to ensure correct pluralization. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. acp/README.md:50
- Draft comment:
Consider revising 'Ensure that the samples has default values to test it out.' to 'Ensure that the samples have default values to test them out.' for proper subject-verb agreement. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. acp/README.md:65
- Draft comment:
Consider changing 'UnDeploy' to 'Undeploy' in the header 'UnDeploy the controller from the cluster:' for consistency with the make target 'undeploy' and standard capitalization. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. acp/config/example-resources.md:198
- Draft comment:
There is an unnecessary backslash before the exclamation mark in "Happy deploying!" on line 198. Consider removing it to correct this typographical error. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_hY5fRIrtxH6EBsmD
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
…or-usermessage-or-contextwindow
|
Last update:
|
| - Used for multi-turn conversations or continuing previous conversations | ||
| - Must contain at least one user message | ||
| - Cannot be used with `userMessage` | ||
| - If no system message is included, the agent's system message will be prepended |
There was a problem hiding this comment.
does it have to end with a user message?
if i POST a contextWindow with tool calls, do the tool calls get created or are they assumed to exist?
not suggesting any new implementation, just clarity in the docs what should be expected. It can have a "for now" on it for now
There was a problem hiding this comment.
Updated docs to reflect current status:
- Tool calls/messages in the contextWindow are NOT executed - they're treated purely as conversation history
- The last message can be any valid role (user, assistant, tool) - the controller will send the entire context to the
LLM - The UserMsgPreview comes from the last user message, not necessarily the last message in the context
A potential improvement might be to require it to end with a user message. I think openai might still respond properly if most recent is a presumed-done "tool" but the api might get upset if it's another assistant.
…or-usermessage-or-contextwindow
Summary
Implements the ability to create tasks with either
userMessageORcontextWindow, but not both.This enhancement allows for more flexible task creation, supporting both simple queries and
multi-turn conversations.
Changes
TaskSpecto makeUserMessageoptional and added optionalContextWindowfieldvalidationpackage with shared validation functions for consistent checks across API and controllercontextWindowusageValidation Rules
userMessageorcontextWindowmust be providedcontextWindow:Behavior
When
contextWindowis used, the controller:UserMsgPreviewfieldstatus.ContextWindowTesting
Important
Enhance task creation to support either
userMessageorcontextWindow, with validation and comprehensive test coverage.TaskSpecnow supportsuserMessageorcontextWindow, but not both.contextWindowmust have valid roles and at least one user message.contextWindow, agent's system prompt is prepended.validationpackage withValidateTaskMessageInput()andGetUserMessagePreview().userMessageorcontextWindowis provided.task_controller.goupdated to handlecontextWindowlogic.prepareForLLM()sets up initial context and phase.server.goupdated to validate task creation requests.createTask()checks for validuserMessageorcontextWindow.task_controller_test.gofor various scenarios.server_test.gofor task creation validation.README.mdandcrd-reference.mdto reflect changes.contextWindowadded inacp_v1alpha1_context_window_task.yaml.This description was created by
for 7e63816. It will automatically update as commits are pushed.