Status describes what is attached to the current session.
()
| 205 | |
| 206 | // Status describes what is attached to the current session. |
| 207 | func (a *contextPluginAdapter) Status() (string, error) { |
| 208 | mgr := a.manager() |
| 209 | if mgr == nil { |
| 210 | return "", fmt.Errorf("context manager unavailable in this session") |
| 211 | } |
| 212 | attached, err := mgr.GetAttachedContexts(a.sessionID()) |
| 213 | if err != nil { |
| 214 | return "", err |
| 215 | } |
| 216 | if len(attached) == 0 { |
| 217 | return "Nothing attached to this session.", nil |
| 218 | } |
| 219 | var b strings.Builder |
| 220 | fmt.Fprintf(&b, "%d context(s) attached to this session:\n", len(attached)) |
| 221 | for _, fc := range attached { |
| 222 | fmt.Fprintf(&b, "- %s — mode=%s, %d unit(s), %s\n", fc.Name, fc.Mode, fc.FileCount, humanMB(fc.TotalSize)) |
| 223 | } |
| 224 | if mgr.RetrievalEnabled() { |
| 225 | b.WriteString("Embeddings: configured (semantic retrieval active).") |
| 226 | } else { |
| 227 | b.WriteString("Embeddings: not configured (keyless lexical retrieval).") |
| 228 | } |
| 229 | return b.String(), nil |
| 230 | } |
| 231 | |
| 232 | // Delete permanently removes a context. |
| 233 | func (a *contextPluginAdapter) Delete(name string) (string, error) { |