MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / goal_context_message

Function goal_context_message

src/sessions/codex.rs:449–473  ·  view source on GitHub ↗
(
    meta: &CodexMeta,
    model: Option<&str>,
    path: &Path,
    offset: i64,
    timestamp: Option<i64>,
    goal_context: &CodexGoalContext,
    metadata: &Value,
)

Source from the content-addressed store, hash-verified

447}
448
449fn goal_context_message(
450 meta: &CodexMeta,
451 model: Option<&str>,
452 path: &Path,
453 offset: i64,
454 timestamp: Option<i64>,
455 goal_context: &CodexGoalContext,
456 metadata: &Value,
457) -> SessionMessageRecord {
458 SessionMessageRecord {
459 provider: PROVIDER.to_string(),
460 message_id: format!("{}:{offset}", meta.session_id),
461 session_id: meta.session_id.clone(),
462 role: "system".to_string(),
463 timestamp,
464 ordinal: offset,
465 text: goal_context.storage_text(),
466 kind: Some("goal_context".to_string()),
467 model: model.map(str::to_string),
468 tool_names: None,
469 source_path: Some(path.to_string_lossy().to_string()),
470 source_offset: Some(offset),
471 metadata_json: serde_json::to_string(&metadata).ok(),
472 }
473}
474
475fn collect_response_item_text(value: &Value) -> String {
476 match value {

Callers 2

message_from_lineFunction · 0.85

Calls 1

storage_textMethod · 0.80

Tested by

no test coverage detected