mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Add goal extension GoalApi (#25096)
## Summary - add an extension-owned `GoalApi` for thread goal get/set/clear operations - register live goal runtimes with the API from the goal extension backend - cover the API and runtime-effect paths in goal extension tests ## Stack Follow-up app-server wiring PR: #25108 ## Validation - `just fmt` - `just fix -p codex-goal-extension` - `just test -p codex-goal-extension`
This commit is contained in:
1 parent
48c16b8bcb
commit
f27bbbd49c
6 files changed
+433
-40
No files matched your search
@@ -363,7 +363,7 @@ where
|
||||
.map_err(|err| FunctionCallError::RespondToModel(err.to_string()))
|
||||
}
|
||||
|
||||
fn validate_goal_budget(value: Option<i64>) -> Result<(), String> {
|
||||
pub(crate) fn validate_goal_budget(value: Option<i64>) -> Result<(), String> {
|
||||
if let Some(value) = value
|
||||
&& value <= 0
|
||||
{
|
||||
@@ -402,7 +402,7 @@ impl GoalToolResponse {
|
||||
}
|
||||
}
|
||||
|
||||
async fn fill_empty_thread_preview_if_possible(
|
||||
pub(crate) async fn fill_empty_thread_preview_if_possible(
|
||||
state_db: &codex_state::StateRuntime,
|
||||
thread_id: ThreadId,
|
||||
goal: &codex_state::ThreadGoal,
|
||||
@@ -441,7 +441,9 @@ fn protocol_status_from_state(status: codex_state::ThreadGoalStatus) -> ThreadGo
|
||||
}
|
||||
}
|
||||
|
||||
fn state_status_from_protocol(status: ThreadGoalStatus) -> codex_state::ThreadGoalStatus {
|
||||
pub(crate) fn state_status_from_protocol(
|
||||
status: ThreadGoalStatus,
|
||||
) -> codex_state::ThreadGoalStatus {
|
||||
match status {
|
||||
ThreadGoalStatus::Active => codex_state::ThreadGoalStatus::Active,
|
||||
ThreadGoalStatus::Paused => codex_state::ThreadGoalStatus::Paused,
|
||||
|
||||
Reference in new issue
Block a user