(
&mut self,
record: &Value,
path: &Path,
meta: &CodexMeta,
)
| 72 | } |
| 73 | |
| 74 | pub(super) fn observe_context_record( |
| 75 | &mut self, |
| 76 | record: &Value, |
| 77 | path: &Path, |
| 78 | meta: &CodexMeta, |
| 79 | ) -> bool { |
| 80 | if let Some(updated) = session_meta_from_record(record, path) { |
| 81 | if updated.session_id == meta.session_id { |
| 82 | self.cwd = Some(updated.cwd); |
| 83 | if updated.git.is_some() { |
| 84 | self.git = updated.git; |
| 85 | } |
| 86 | if updated.model.is_some() { |
| 87 | self.model = updated.model; |
| 88 | } |
| 89 | } |
| 90 | return true; |
| 91 | } |
| 92 | if let Some(context) = turn_context_from_record(record) { |
| 93 | if context.model.is_some() { |
| 94 | self.model = context.model; |
| 95 | } |
| 96 | if context.cwd.is_some() { |
| 97 | self.cwd = context.cwd; |
| 98 | } |
| 99 | return true; |
| 100 | } |
| 101 | false |
| 102 | } |
| 103 | |
| 104 | fn observe_prior_record(&mut self, record: &Value, path: &Path, meta: &CodexMeta) { |
| 105 | if record.get("type").and_then(Value::as_str) == Some("compacted") { |
no test coverage detected