# How `DEVELOPMENT_MODE` Affects Hiring Agent's Behavior: Configuration and Runtime Impact

> Learn how DEVELOPMENT_MODE impacts Hiring Agent's behavior by toggling cache-driven development or live production execution. Understand its effects on network requests, caching, and output.

- Repository: [HackerRank/hiring-agent](https://github.com/interviewstreet/hiring-agent)
- Tags: internals
- Published: 2026-07-03

---

**`DEVELOPMENT_MODE` is a boolean flag defined in [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) that toggles between cache-driven development workflows and live-data production execution, controlling network requests, file caching, and output verbosity throughout the interviewstreet/hiring-agent codebase.**

The `DEVELOPMENT_MODE` flag serves as the central configuration switch for the Hiring Agent's runtime behavior. Defined in the repository's configuration module, this boolean determines whether the system operates in a developer-friendly mode with local caching and verbose diagnostics, or in a streamlined production mode that fetches fresh data from external APIs. Understanding this flag is essential for anyone deploying or contributing to the interviewstreet/hiring-agent project.

## What is DEVELOPMENT_MODE and Where is it Defined?

In [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) (line 6), `DEVELOPMENT_MODE` is initialized as a boolean with a default value of `True`. This design choice prioritizes the developer experience out of the box, ensuring that new contributors can run the agent without immediately hitting GitHub API rate limits or waiting for network requests.

```python

# config.py

DEVELOPMENT_MODE = True   # Set to False for production deployments

```

When `True`, the Hiring Agent assumes it is running in a development environment where speed and debuggability matter more than data freshness. When `False`, it assumes a production context where up-to-date information and minimal output are required.

## Caching Behavior in score.py

The [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) module implements conditional logic that checks `DEVELOPMENT_MODE` before reading from or writing to local cache files. According to the source code, this affects three specific operations:

- **Cache Reading**: When `DEVELOPMENT_MODE` is `True` and a cache file exists at `cache_filename`, the module loads raw GitHub data from local JSON rather than making network requests.
- **Cache Writing**: After fetching fresh data, the system writes results back to the cache only when `DEVELOPMENT_MODE` is enabled.
- **Verbose Logging**: Debug messages that embed cache file locations are printed only when the flag is active.

```python

# score.py implementation pattern

if DEVELOPMENT_MODE and os.path.exists(cache_filename):
    with open(cache_filename) as f:
        return json.load(f)  # Return cached payload

# Later, after fetching live data...

if DEVELOPMENT_MODE:
    with open(cache_filename, "w") as f:
        json.dump(data, f)

```

When set to `False`, [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) bypasses all cache operations and proceeds directly to live data fetching, ensuring that scoring calculations use the most current repository information available.

## GitHub API Integration and Rate Limiting

In [`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py), `DEVELOPMENT_MODE` controls how the wrapper handles GitHub API responses and rate limiting. The module uses the flag to determine whether to store raw API payloads under the `cache/` directory and whether to bypass rate-limit handling when cached successful responses exist.

Specifically, when `DEVELOPMENT_MODE` is `True`:
- API responses are written to `cache/` subdirectories to make repetitive testing deterministic
- Cached 200-status responses are reused to avoid hitting the live API during development cycles
- The system checks `if DEVELOPMENT_MODE and status_code == 200` before allowing cache hits to satisfy requests

When `False`, every invocation contacts the GitHub API directly, ensuring no stale data influences hiring decisions and that rate-limit logic operates against real API headers.

## Output Verbosity and Reporting

The flag also controls the verbosity of the final scoring report generated by [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py). In the report generation logic, the code conditionally appends diagnostic text using a ternary expression:

```python
report_message = "Score calculated" + (" and caching to " + cache_filename if DEVELOPMENT_MODE else "")

```

This means:
- **Development Mode**: Reports include cache paths and internal state information that helps developers understand which data sources were used
- **Production Mode**: Reports contain only user-facing scores without internal file system references or debugging details

Additionally, any `print` statements or logging calls wrapped in `if DEVELOPMENT_MODE:` blocks execute only when the flag is enabled, keeping production stdout clean while providing diagnostic visibility during development.

## Practical Configuration Example

To configure the Hiring Agent for different environments, modify the flag in [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) or override it at runtime:

```python

# config.py

DEVELOPMENT_MODE = True   # Development: fast, cached, verbose

# DEVELOPMENT_MODE = False  # Production: live data, minimal output

```

**Development Mode Execution:**

```bash
$ python score.py
[INFO] Loading cached GitHub data from cache/github_repo_123.json
Score: 85 (cached)

```

**Production Mode Execution:**

```bash
$ python score.py
Fetching live data from GitHub…
Score: 85

```

## Summary

- **`DEVELOPMENT_MODE`** is defined in [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) with a default value of `True`, prioritizing developer experience.
- When enabled, **[`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py)** reads from and writes to local JSON caches, avoiding repeated GitHub API calls.
- **[`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py)** uses the flag to store API responses locally and bypass rate limits using cached 200-status responses during development.
- The flag controls output verbosity, with **development mode** exposing cache paths and diagnostic details, while **production mode** emits only essential scoring information.
- Setting the flag to `False` ensures the Hiring Agent always fetches live data, making it suitable for production deployments where data freshness is critical.

## Frequently Asked Questions

### Where is the DEVELOPMENT_MODE flag defined in the Hiring Agent repository?

The `DEVELOPMENT_MODE` flag is defined in [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) at line 6 as a boolean variable with a default value of `True`. This central location allows all other modules to import the setting from a single source of truth.

### How does DEVELOPMENT_MODE affect GitHub API rate limiting?

When `DEVELOPMENT_MODE` is `True`, the [`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py) module caches successful API responses (200-status codes) and reuses them for subsequent identical requests, effectively bypassing live API calls during development. When `False`, the system always contacts the GitHub API directly, ensuring rate-limit headers are current and accurate.

### Can I use cached data in production by keeping DEVELOPMENT_MODE enabled?

While technically possible, it is not recommended. Running with `DEVELOPMENT_MODE = True` in production risks scoring candidates based on stale repository data, as the system will read from local cache files rather than fetching current information from GitHub.

### What files are affected by the DEVELOPMENT_MODE configuration?

According to the interviewstreet/hiring-agent source code, three primary files consume this flag:
- [`config.py`](https://github.com/interviewstreet/hiring-agent/blob/main/config.py) (where it is defined)
- [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) (which handles caching logic and report verbosity)
- [`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py) (which manages API integration and response caching)