Debugging

यह पृष्ठ streaming output के लिए debugging helpers को कवर करता है, विशेष रूप से जब एक provider सामान्य text में reasoning को मिलाता है।

Runtime debug overrides

Runtime-only कॉन्फ़िगरेशन overrides (memory, disk नहीं) सेट करने के लिए chat में /debug का उपयोग करें। /debug डिफ़ॉल्ट रूप से अक्षम है; commands.debug: true के साथ सक्षम करें। यह तब सुविधाजनक है जब आपको mayros.json संपादित किए बिना obscure settings toggle करने की आवश्यकता हो।

उदाहरण:

/debug show
/debug set messages.responsePrefix="[mayros]"
/debug unset messages.responsePrefix
/debug reset

/debug reset सभी overrides clear करता है और on-disk कॉन्फ़िगरेशन पर लौटता है।

Gateway watch mode

तेज़ iteration के लिए, file watcher के तहत gateway चलाएं:

bash
pnpm gateway:watch

यह इसके लिए maps करता है:

bash
node --watch-path src --watch-path tsconfig.json --watch-path package.json --watch-preserve-output scripts/run-node.mjs gateway --force

gateway:watch के बाद कोई भी gateway CLI flags जोड़ें और उन्हें प्रत्येक restart पर pass किया जाएगा।

Dev profile + dev gateway (--dev)

State को isolate करने और debugging के लिए एक safe, disposable setup spin करने के लिए dev profile का उपयोग करें। दो --dev flags हैं:

  • Global --dev (profile): ~/.mayros-dev के तहत state को isolate करता है और gateway port को 19001 पर default करता है (derived ports इसके साथ shift होते हैं)।
  • gateway --dev: Gateway को missing होने पर default कॉन्फ़िगरेशन + workspace auto-create करने के लिए कहता है (और BOOTSTRAP.md skip करता है)।

अनुशंसित flow (dev profile + dev bootstrap):

bash
pnpm gateway:dev
MAYROS_PROFILE=dev mayros tui

यदि आपके पास अभी तक global install नहीं है, तो pnpm mayros ... के माध्यम से CLI चलाएं।

यह क्या करता है:

  1. Profile isolation (global --dev)

    • MAYROS_PROFILE=dev
    • MAYROS_STATE_DIR=~/.mayros-dev
    • MAYROS_CONFIG_PATH=~/.mayros-dev/mayros.json
    • MAYROS_GATEWAY_PORT=19001 (browser/canvas तदनुसार shift करते हैं)
  2. Dev bootstrap (gateway --dev)

    • Missing होने पर एक minimal कॉन्फ़िगरेशन लिखता है (gateway.mode=local, bind loopback)।
    • agent.workspace को dev workspace पर सेट करता है।
    • agent.skipBootstrap=true सेट करता है (कोई BOOTSTRAP.md नहीं)।
    • Missing होने पर workspace files को seeds करता है: AGENTS.md, MAYROS.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md
    • डिफ़ॉल्ट identity: C3‑PO (protocol droid)।
    • Dev mode में channel providers skip करता है (MAYROS_SKIP_CHANNELS=1)।

Reset flow (ताज़ा शुरुआत):

bash
pnpm gateway:dev:reset

नोट: --dev एक global profile flag है और कुछ runners द्वारा खाया जाता है। यदि आपको इसे spell out करने की आवश्यकता है, तो env var form का उपयोग करें:

bash
MAYROS_PROFILE=dev mayros gateway --dev --reset

--reset कॉन्फ़िगरेशन, credentials, sessions और dev workspace को wipes करता है (trash का उपयोग करके, rm नहीं), फिर डिफ़ॉल्ट dev setup को recreate करता है।

सुझाव: यदि कोई non‑dev gateway पहले से चल रहा है (launchd/systemd), तो पहले इसे रोकें:

bash
mayros gateway stop

Raw stream logging (Mayros)

Mayros किसी भी filtering/formatting से पहले raw assistant stream को log कर सकता है। यह देखने का सबसे अच्छा तरीका है कि क्या reasoning plain text deltas के रूप में आ रहा है (या अलग thinking blocks के रूप में)।

इसे CLI के माध्यम से सक्षम करें:

bash
pnpm gateway:watch --raw-stream

वैकल्पिक path override:

bash
pnpm gateway:watch --raw-stream --raw-stream-path ~/.mayros/logs/raw-stream.jsonl

Equivalent env vars:

bash
MAYROS_RAW_STREAM=1
MAYROS_RAW_STREAM_PATH=~/.mayros/logs/raw-stream.jsonl

डिफ़ॉल्ट file:

~/.mayros/logs/raw-stream.jsonl

Raw chunk logging (pi-mono)

Blocks में parse होने से पहले raw OpenAI-compat chunks को capture करने के लिए, pi-mono एक अलग logger expose करता है:

bash
PI_RAW_STREAM=1

वैकल्पिक path:

bash
PI_RAW_STREAM_PATH=~/.pi-mono/logs/raw-openai-completions.jsonl

डिफ़ॉल्ट file:

~/.pi-mono/logs/raw-openai-completions.jsonl

नोट: यह केवल pi-mono के openai-completions provider का उपयोग करने वाली processes द्वारा emitted है।

Safety नोट्स

  • Raw stream logs में पूर्ण prompts, tool output और user डेटा शामिल हो सकते हैं।
  • Logs को स्थानीय रखें और debugging के बाद उन्हें delete करें।
  • यदि आप logs साझा करते हैं, तो पहले secrets और PII scrub करें।