DEV Community

Cover image for Codex CLI को कैसे दिखाएँ कि पिछली check के बाद आपके osFoundry project में क्या बदला
BBT for BBT हिन्दी

Posted on

Codex CLI को कैसे दिखाएँ कि पिछली check के बाद आपके osFoundry project में क्या बदला

इस guide के आख़िर तक Codex CLI "कल से Launch plan project में क्या बदला?" का जवाब दे पाएगा, वह भी project के हर note और channel को दोबारा पढ़े बिना। वह osFoundry से पूछता है कि owner ने कौन से resources grant किए हैं (list_granted_resources), project में क्या-क्या है (list_project_resources), और फिर हर resource से सिर्फ़ वे events माँगता है जो उसके देखे हुए आख़िरी sequence number के बाद आए (poll_resource_events)। ये numbers आपके repo की एक छोटी file में रहते हैं, इसलिए अगला Codex session वहीं से शुरू करता है जहाँ पिछला रुका था। हर call osFoundry में connection की Recent activity में दिखती है।

कौन क्या करता है

Codex CLI osFoundry
Login osFoundry का OAuth token रखता है, osfoundry:read काफ़ी है Owner Connected tab में connection को एक बार approve करता है
वह क्या देख सकता है जो list_granted_resources लौटाए, बस वही Owner तय करता है: connection में add किए गए projects, और वे Message channels जिनमें उसे invite किया गया
"आख़िरी बार देखा" वाली state कहाँ रहती है हर resource का एक integer, जिसे Codex रखता है (यहाँ .osfoundry/cursors.json में) हर resource का ordered event log, जो किसी sequence number से पढ़ा जाता है
बदलाव होने पर क्या चलता है Codex तय करता है: वह note दोबारा पढ़े, channel पढ़े, या सिर्फ़ report करे कुछ नहीं। Polling server पर कभी कुछ नहीं बदलता
इसे कौन रोक सकता है आप, पूछना बंद करके Owner project हटा दे, कोई tool untick कर दे, या connection revoke कर दे

Setup

1. Codex connection ढूँढें

osFoundry में header का key icon Connected tab खोलता है। अगर Codex अभी connected नहीं है, तो Assistant में Other MCP client चुनें, उसे Codex CLI जैसा कोई display name दें और Add assistant पर click करें। Panel में server address दिखता है जो आपको Codex को देना है।

उदाहरण: Connected agents tab, जिसमें एक active Codex CLI connection है

उदाहरण: Connected agents tab, जिसमें एक active Codex CLI connection है

Codex की तरफ़:

codex mcp add osfoundry --url https://api.osfoundry.io/api/v1/external-mcp
codex mcp login osfoundry
Enter fullscreen mode Exit fullscreen mode

2. तय करें कि Codex क्या watch कर सकता है

यह owner का हिस्सा है, और "Codex क्या देखेगा?" का पूरा जवाब यही है। Connection select करें और Projects खोलें। "Choose a project" में कोई project चुनें और Add to project पर click करें। Help line बताती है कि इससे क्या grant होता है: "Adding this agent to a project gives it access to supported synced content in that project and its discussion channel. Other Message channels require a separate invitation."

यानी एक project से Codex को उसके notes, knowledge bases, record channels, Rooms, GitNest repositories और sessions मिलते हैं, साथ में project का discussion channel भी। कोई भी दूसरा Message channel एक अलग, explicit step है: नीचे Message channels में उसे "Choose a Message channel" में चुनें और Invite पर click करें।

उदाहरण: Codex CLI connection, जिसमें Launch plan project add है और एक Message channel invite किया गया है

उदाहरण: Codex CLI connection, जिसमें Launch plan project add है और एक Message channel invite किया गया है

Project access आने से पहले save की गई permissions "Older individual access" में दिखती हैं। list_granted_resources इन्हें भी individually granted resources के रूप में लौटाता है, इसलिए यह मानने से पहले कि project ही अंदर आने का इकलौता रास्ता है, वह section ज़रूर देख लें।

3. तीनों tools ticked रखें

उसी connection पर Tools खोलें। "All supported tools are on by default." list granted resources, list project resources और poll resource events को ticked रहने दें, साथ में वे readers भी जिनकी Codex को कुछ बदलने का पता चलने के बाद ज़रूरत होगी (read note tab, read channel messages वगैरह)। यहाँ कोई tool untick करने से वह osFoundry की तरफ़ से हट जाता है, Codex का अपना config कुछ भी कहे।

4. Codex को watch loop तक सीमित करें

# ~/.codex/config.toml
[mcp_servers.osfoundry]
url = "https://api.osfoundry.io/api/v1/external-mcp"
scopes = ["osfoundry:read"]
enabled_tools = [
  "list_granted_resources",
  "list_project_resources",
  "poll_resource_events",
  "list_note_tabs",
  "read_note_tab",
  "read_channel_messages",
]
Enter fullscreen mode Exit fullscreen mode

छहों tools server पर read-only marked हैं, इसलिए Codex उन्हें बिना पूछे चलाता है।

5. Codex को बताएँ कि cursors कहाँ रखने हैं

Codex हर session नए सिरे से शुरू करता है, इसलिए हर resource का आख़िरी sequence ऐसी जगह होना चाहिए जिसे वह पढ़ सके। Repo में एक AGENTS.md यह काम कर देता है:

## osFoundry changes
- Cursors are in .osfoundry/cursors.json: {"<resource_type>:<resource_id>": <last sequence>}.
- Start with list_granted_resources. Drop cursors for resources it no longer returns.
- For each watched resource call poll_resource_events with after_sequence from the file
  and limit 100. If a page comes back full, call again from its last sequence.
- Only after reporting the changes, write the new sequence back to the file.
- A resource with no cursor yet: poll from after_sequence 0 once to get its current sequence.
Enter fullscreen mode Exit fullscreen mode

Cursor को report के बाद लिखना, पहले नहीं, इसका मतलब है कि बीच में बंद हुआ session अगली बार वही events फिर दिखाएगा, उन्हें खोएगा नहीं।

एक असली run

जिस machine पर यह लिखा गया, उस पर Codex install नहीं है, इसलिए नीचे का session एक simulated उदाहरण है। Tool names और argument names live server के हैं, उसी mcp__osfoundry__ prefix के साथ जो Codex जोड़ता है। Project, resources, sequence numbers और results demo content हैं।

Example (simulated)

> What changed in the Launch plan project since my last check?

• mcp__osfoundry__list_granted_resources {}
  ← project "Launch plan"; message_channel "launch-updates" (invited)
• mcp__osfoundry__list_project_resources {"project_id": "…", "resource_type": "note"}
  ← 3 notes: "Launch checklist", "Pricing page copy", "Press list"
• mcp__osfoundry__poll_resource_events {"resource_type": "note", "resource_id": "…",
      "after_sequence": 118, "limit": 100}            (Launch checklist)
  ← 2 events, last sequence 120
• mcp__osfoundry__poll_resource_events {… "Pricing page copy", "after_sequence": 64 …}
  ← no events
• mcp__osfoundry__poll_resource_events {… "Press list", "after_sequence": 9 …}
  ← no events
• mcp__osfoundry__poll_resource_events {"resource_type": "message_channel",
      "resource_id": "…", "after_sequence": 311, "limit": 100}
  ← 5 events, last sequence 316
• mcp__osfoundry__read_note_tab {"note_id": "…", "tab_id": "…"}   (Launch checklist)
• mcp__osfoundry__read_channel_messages {"channel_id": "…", "limit": 5}
  (Codex writes 120 and 316 back to .osfoundry/cursors.json)

Two things moved since yesterday. In "Launch checklist", the press embargo
line now says Thursday 09:00 instead of Wednesday. In launch-updates, five
messages: the pricing page is approved, and the App Store build is still in
review. "Pricing page copy" and "Press list" haven't changed.
Enter fullscreen mode Exit fullscreen mode

चार polls, दो reads। Cursors के बिना यही जवाब पाने के लिए तीनों notes और channel को पूरा पढ़ना पड़ता और उन्हें Codex की याद से मिलाना पड़ता, जो कि खाली है।

Owner की तरफ़ हर call connection की Recent activity में एक line होती है: tool का नाम, decision और समय।

उदाहरण: एक check के बाद Codex CLI connection के Tools और Recent activity

उदाहरण: एक check के बाद Codex CLI connection के Tools और Recent activity

सीमा कहाँ है

Codex को सिर्फ़ वही दिखता है जो list_granted_resources list करता है। Server का अपना initialize reply कहता है "Use list_granted_resources first", और यह call कोई argument नहीं लेती: Codex किसी project का नाम लेकर अंदर नहीं आ सकता। जो Message channel project का discussion channel नहीं है, वह तब तक invisible रहता है जब तक owner connection को उसमें invite न करे। list_project_resources का description यही दोहराता है: "Ordinary Message channels require a separate invitation."

Polling पढ़ता है, subscribe नहीं करता। Server सिर्फ़ tools advertise करता है, इसलिए osFoundry कभी Codex को जगाता नहीं। यह वैसे भी Codex के काम करने के तरीके से मेल खाता है: वह तब देखता है जब आप उसे चलाते हैं, और cursors "पिछली बार से अब तक" को सस्ता बना देते हैं।

poll_resource_events एक call में एक resource पर काम करता है। "पूरे project" का कोई cursor नहीं है। इससे हर log छोटा रहता है और हर grant अलग। जब owner project हटाता है, तो उसके resources के polls काम करना बंद कर देते हैं, और अगला list_granted_resources उन्हें list नहीं करता। तब Codex को वे cursors हटा देने चाहिए, retry नहीं करने चाहिए।

Graph sessions एक special case हैं। poll_resource_events, graph_session स्वीकार करता है, लेकिन Graphs owner के desktop पर रहते हैं। वे connection तक तभी पहुँचते हैं जब owner उन्हें "Share desktop Graph sessions" में tick करे और desktop app खुला और signed in हो। जो कुछ भी सिर्फ़ device पर है, वह वहीं रहता है। initialize reply कहता है "Local-only data is unavailable to cloud clients."

आगे इसे अपनी morning routine में डालें: कुछ और खोलने से पहले, AGENTS.md वाले repo से codex exec "What changed in the Launch plan project since my last check?" चलाएँ। हर connection को कौन से tools मिलते हैं, और access अब भी project के हिसाब से क्यों तय होता है, यह tool scope page पर है। नीचे का protocol MCP glossary entry में है।

Top comments (0)