Skip to content

fix(craft): only include org_info/ when demo data enabled#7845

Merged
rohoswagger merged 1 commit intomainfrom
roshan/org_info-demo-data
Jan 27, 2026
Merged

fix(craft): only include org_info/ when demo data enabled#7845
rohoswagger merged 1 commit intomainfrom
roshan/org_info-demo-data

Conversation

@rohoswagger
Copy link
Copy Markdown
Contributor

@rohoswagger rohoswagger commented Jan 27, 2026

Description

we were always including org_info/ directory in root and in AGENTS.md, should only be done when using demo data

How Has This Been Tested?

locally

Additional Options

  • [Optional] Override Linear Check

@rohoswagger rohoswagger requested a review from a team as a code owner January 27, 2026 01:59
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

Conditionally includes the org_info section in AGENTS.md based on whether demo data is enabled, preventing non-demo sandboxes from referencing missing org_info/ files.

  • Replaced hardcoded org_info text in the template with a {{ORG_INFO_SECTION}} placeholder
  • Added build_org_info_section() function that returns the org_info content when include_org_info=True, or an empty string otherwise
  • Threaded the include_org_info flag through the sandbox managers (Kubernetes and local) and directory manager
  • Both sandbox managers now pass use_demo_data as the include_org_info parameter when generating agent instructions

The implementation is clean and follows the existing pattern of template placeholder replacement. The change prevents confusion and errors in non-demo environments where the org_info/ directory doesn't exist.

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The implementation is straightforward, clean, and follows established patterns in the codebase. The flag is correctly threaded through all necessary layers, the template replacement logic is simple and correct, and the change solves the stated problem without introducing any side effects or edge cases.
  • No files require special attention

Important Files Changed

Filename Overview
backend/onyx/server/features/build/AGENTS.template.md Replaced hardcoded org_info section with {{ORG_INFO_SECTION}} placeholder for conditional rendering
backend/onyx/server/features/build/sandbox/util/agent_instructions.py Added build_org_info_section() function and include_org_info parameter to conditionally render org_info content
backend/onyx/server/features/build/sandbox/manager/directory_manager.py Added include_org_info parameter to setup_agent_instructions() and passed it through to generate_agent_instructions()
backend/onyx/server/features/build/sandbox/kubernetes/kubernetes_sandbox_manager.py Added include_org_info parameter to _load_agent_instructions() and wired it through to pass use_demo_data flag
backend/onyx/server/features/build/sandbox/local/local_sandbox_manager.py Passed include_org_info=use_demo_data to setup_agent_instructions() in session workspace setup

Sequence Diagram

sequenceDiagram
    participant SM as SandboxManager
    participant DM as DirectoryManager
    participant AI as agent_instructions.py
    participant T as AGENTS.template.md

    Note over SM: setup_session_workspace called with use_demo_data flag

    SM->>DM: setup_agent_instructions(include_org_info=use_demo_data)
    DM->>AI: generate_agent_instructions(include_org_info)
    AI->>AI: build_org_info_section(include_org_info)
    
    alt include_org_info is True
        AI->>AI: Return ORG_INFO_SECTION_CONTENT
    else include_org_info is False
        AI->>AI: Return empty string
    end
    
    AI->>T: Read template file
    T-->>AI: Template with {{ORG_INFO_SECTION}} placeholder
    AI->>AI: Replace {{ORG_INFO_SECTION}} with org_info_section
    AI-->>DM: Generated AGENTS.md content
    DM->>DM: Write to sandbox/AGENTS.md
    DM-->>SM: Setup complete
Loading

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@rohoswagger rohoswagger force-pushed the roshan/org_info-demo-data branch from eae0f5f to dba13cd Compare January 27, 2026 02:49
@rohoswagger rohoswagger added this pull request to the merge queue Jan 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 27, 2026
@rohoswagger rohoswagger force-pushed the roshan/org_info-demo-data branch from dba13cd to 080dc4f Compare January 27, 2026 19:31
@rohoswagger rohoswagger enabled auto-merge January 27, 2026 19:31
@rohoswagger rohoswagger added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit d9e3b65 Jan 27, 2026
74 of 75 checks passed
@rohoswagger rohoswagger deleted the roshan/org_info-demo-data branch January 27, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants