-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Improve goal continuation based on feedback #22045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8e289ef
f5e71e1
64e3ab2
ce7b04b
fd084ca
7c6e44e
22bdc5e
5e9b9b8
eaf747d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| //! Hidden user-context fragment for runtime-owned goal steering prompts. | ||
|
|
||
| use super::ContextualUserFragment; | ||
|
|
||
| #[derive(Debug, Clone, PartialEq)] | ||
| pub(crate) struct GoalContext { | ||
| pub(crate) prompt: String, | ||
| } | ||
|
|
||
| impl ContextualUserFragment for GoalContext { | ||
| const ROLE: &'static str = "user"; | ||
| const START_MARKER: &'static str = "<goal_context>"; | ||
| const END_MARKER: &'static str = "</goal_context>"; | ||
|
|
||
| fn body(&self) -> String { | ||
| format!("\n{}\n", self.prompt) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| use super::parse_turn_item; | ||
| use crate::context::ContextualUserFragment; | ||
| use crate::context::GoalContext; | ||
| use codex_protocol::items::AgentMessageContent; | ||
| use codex_protocol::items::HookPromptFragment; | ||
| use codex_protocol::items::TurnItem; | ||
|
|
@@ -302,6 +304,23 @@ fn parses_hook_prompt_and_hides_other_contextual_fragments() { | |
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn goal_context_does_not_parse_as_visible_turn_item() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this proves the stale-steer claim.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I didn't realize that compaction ignored hidden user context. Yeah, this will require more work. I'd prefer to do that as a follow-up PR. This PR doesn't solve the compaction problem but it doesn't make it any worse. |
||
| let item = ResponseItem::Message { | ||
| id: Some("msg-1".to_string()), | ||
| role: "user".to_string(), | ||
| content: vec![ContentItem::InputText { | ||
| text: GoalContext { | ||
| prompt: "Continue working toward the active thread goal.".to_string(), | ||
| } | ||
| .render(), | ||
| }], | ||
| phase: None, | ||
| }; | ||
|
|
||
| assert!(parse_turn_item(&item).is_none()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_agent_message() { | ||
| let item = ResponseItem::Message { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, this will still get discarded by compaction