mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
## Why `ext/goal` already had the tool specs and contributor wiring for `/goal`, but the installed tools still depended on a placeholder backend that always errored. That meant the extension could not actually own goal persistence even though the dedicated `thread_goals` store already exists. This change wires the extension tools directly to the dedicated goal store so the extension can create, read, and complete goals against real state instead of falling back to host-side placeholders. ## What changed - make `install_with_backend(...)` require `Arc<codex_state::StateRuntime>` so goal storage is always available when the extension is installed - remove the unused no-backend/public backend abstraction from `ext/goal` and have the tool executors talk directly to `StateRuntime` - map `thread_goals` rows into the existing protocol response shape for `get_goal`, `create_goal`, and `update_goal` - preserve current thread-list behavior by filling an empty thread preview from the goal objective when a goal is created through the extension path - add integration coverage for the installed tool surface, including successful goal creation and duplicate-create rejection ## Testing - `cargo test -p codex-goal-extension`
20 lines
597 B
Rust
20 lines
597 B
Rust
//! Extension crate sketch for the `/goal` feature.
|
|
//!
|
|
//! This crate is intentionally not wired into the host yet. It contains the
|
|
//! goal tool specs, extension registration shape, and the parts of runtime
|
|
//! accounting that can be represented with today's extension API.
|
|
|
|
mod accounting;
|
|
mod events;
|
|
mod extension;
|
|
mod spec;
|
|
mod tool;
|
|
|
|
pub use extension::GoalExtension;
|
|
pub use extension::GoalExtensionConfig;
|
|
pub use extension::install_with_backend;
|
|
pub use spec::CREATE_GOAL_TOOL_NAME;
|
|
pub use spec::GET_GOAL_TOOL_NAME;
|
|
pub use spec::UPDATE_GOAL_TOOL_NAME;
|
|
pub use tool::CreateGoalRequest;
|