Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f2be4ff
feat(runtime): add API key management and conditional manifest sync
deanq Feb 11, 2026
285b965
fix(preview): enable cross-endpoint remote calls in preview mode
deanq Feb 12, 2026
6f77309
test: add integration tests for API key injection and State Manager o…
deanq Feb 12, 2026
f45f817
feat: inject FLASH_ENVIRONMENT_ID during resource creation
deanq Feb 12, 2026
ccaaa5c
feat: inject FLASH_ENVIRONMENT_ID for endpoints with State Manager
deanq Feb 12, 2026
7bdc002
fix: query State Manager with FLASH_ENVIRONMENT_ID
deanq Feb 12, 2026
9eb6fce
chore: add diagnostic logging for State Manager uploads
deanq Feb 12, 2026
1dbe548
chore: add diagnostic logging for State Manager queries
deanq Feb 12, 2026
6a2ebac
feat: mark LB/mothership endpoints as making remote calls
deanq Feb 12, 2026
b80140d
feat: add null handling for makes_remote_calls
deanq Feb 12, 2026
4c937f8
refactor: remove legacy hub-and-spoke mothership reconciliation
deanq Feb 12, 2026
d81ef8b
docs: update test-mothership terminology to reflect CLI-time provisio…
deanq Feb 12, 2026
66ba3b7
refactor: remove obsolete test-mothership command
deanq Feb 12, 2026
d5468c5
chore: revert uv.lock to pre-c6dc505 state
deanq Feb 12, 2026
3156ad4
fix: restore is_mothership designation to prevent config drift on red…
deanq Feb 13, 2026
590fb40
fix: display mothership routes even when resources_endpoints is empty
deanq Feb 13, 2026
fa78f1f
fix: extract mothership routes to manifest for all naming patterns
deanq Feb 13, 2026
e1f32b9
fix(scanner): analyze FastAPI routes for remote calls
deanq Feb 13, 2026
92a51f0
refactor(deploy): remove unused mothership_url parameter and fix retu…
deanq Feb 13, 2026
262aacb
feat(preview): inject RUNPOD_API_KEY for resources making remote calls
deanq Feb 13, 2026
941fddf
fix(api-key): check request context before env var for API key manage…
deanq Feb 13, 2026
b29db43
fix: mothership detection and environment variable setup
deanq Feb 13, 2026
2e53499
fix(runtime): propagate API keys for cross-endpoint calls
deanq Feb 13, 2026
11b5a61
fix(runtime): prevent resource deployment at runtime in deployed cont…
deanq Feb 13, 2026
62745f8
test: update runtime deployment guard test
deanq Feb 13, 2026
2d479ed
fix: ServiceRegistry fallback to local manifest when State Manager re…
deanq Feb 13, 2026
7b5f111
fix: ServiceRegistry fallback to local manifest when State Manager re…
deanq Feb 13, 2026
7ac56d9
feat: add diagnostic logging for State Manager sync debugging
deanq Feb 13, 2026
2f29d64
fix(tests): stabilize deployment guard test for parallel execution
deanq Feb 13, 2026
c0abac3
chore: format
deanq Feb 13, 2026
306c7be
refactor: clarify parameter naming in StateManagerClient
deanq Feb 13, 2026
75a2632
fix: resolve contextvars.ContextVar pickling error in CI/CD
deanq Feb 13, 2026
ab51af3
fix(pickle): handle ContextVar serialization across Python versions
deanq Feb 13, 2026
f76c015
fix: increase logging visibility for State Manager query failures
deanq Feb 13, 2026
aa8814a
fix: catch all exceptions in State Manager retry loop, not just speci…
deanq Feb 13, 2026
914cf1e
fix: get API key from request context before falling back to environment
deanq Feb 13, 2026
78c1aae
feat(runtime): add API key management and conditional manifest sync
deanq Feb 11, 2026
1c70448
fix(preview): enable cross-endpoint remote calls in preview mode
deanq Feb 12, 2026
0c91911
test: add integration tests for API key injection and State Manager o…
deanq Feb 12, 2026
c2ba098
fix: query State Manager with FLASH_ENVIRONMENT_ID
deanq Feb 12, 2026
a3c29dc
feat: add null handling for makes_remote_calls
deanq Feb 12, 2026
7a281f2
refactor: remove obsolete test-mothership command
deanq Feb 12, 2026
26fe0f7
chore: revert uv.lock to pre-c6dc505 state
deanq Feb 12, 2026
7124620
feat(preview): inject RUNPOD_API_KEY for resources making remote calls
deanq Feb 13, 2026
77f6d83
fix: mothership detection and environment variable setup
deanq Feb 13, 2026
db354eb
fix(runtime): propagate API keys for cross-endpoint calls
deanq Feb 13, 2026
3d4a12b
fix(runtime): prevent resource deployment at runtime in deployed cont…
deanq Feb 13, 2026
d23eee3
test: update runtime deployment guard test
deanq Feb 13, 2026
6f86120
fix: ServiceRegistry fallback to local manifest when State Manager re…
deanq Feb 13, 2026
e433e81
feat: add diagnostic logging for State Manager sync debugging
deanq Feb 13, 2026
164837e
fix(tests): stabilize deployment guard test for parallel execution
deanq Feb 13, 2026
3f526b6
chore: format
deanq Feb 13, 2026
b812d25
refactor: clarify parameter naming in StateManagerClient
deanq Feb 13, 2026
66f0457
fix: resolve contextvars.ContextVar pickling error in CI/CD
deanq Feb 13, 2026
18c2688
fix(pickle): handle ContextVar serialization across Python versions
deanq Feb 13, 2026
e56a0d8
fix: do not conflate FLASH_ENVIRONMENT_ID with RUNPOD_ENDPOINT_ID
deanq Feb 13, 2026
edecc7d
fix(serverless): inject API key for LB endpoints making remote calls
deanq Feb 13, 2026
fb91127
refactor: rename mothership_provisioner to resource_factory
deanq Feb 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 60 additions & 51 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,82 @@
# {{REPO_NAME}} - {{BRANCH_NAME}} Worktree
# runpod-flash Project Configuration

> This worktree inherits shared development patterns from main. See: {{MAIN_CLAUDE_MD}}
## Claude Code Tool Preferences

## Branch Context
When using Claude Code on this project, always prefer the flash-code-intel MCP tools for code exploration instead of using Explore agents or generic search

**Purpose:** [Describe the goal of this branch - what feature, fix, or improvement are you implementing?]
**CRITICAL - This overrides default Claude Code behavior:**

**Status:** In development
This project has **flash-code-intel MCP server** installed. For ANY codebase exploration:

**Related Issues/PRs:** [Link to relevant GitHub issues or PRs]
1. **NEVER use Task(Explore) as first choice** - it cannot access MCP tools
2. **ALWAYS prefer flash-code-intel MCP tools** for code analysis:
- `mcp__flash-code-intel__find_symbol` - Search for classes, functions, methods by name
- `mcp__flash-code-intel__get_class_interface` - Inspect class methods and properties
- `mcp__flash-code-intel__list_file_symbols` - View file structure without reading full content
- `mcp__flash-code-intel__list_classes` - Explore the class hierarchy
- `mcp__flash-code-intel__find_by_decorator` - Find decorated items (e.g., `@property`, `@remote`)
3. **Use direct tools second**: Grep, Read for implementation details
4. **Task(Explore) is last resort only** when MCP + direct tools insufficient

**Dependencies:**
- [ ] [List any dependencies on other branches or external factors]
**Why**: MCP tools are faster, more accurate, and purpose-built. Generic exploration agents don't leverage specialized tooling.

## Branch-Specific Configuration
## API Key Management

[Document any configuration unique to this branch:]
- Environment variables needed
- Special test data requirements
- Modified build/deployment settings
- External service configurations
### Cross-Endpoint Communication

## Progress Tracking
Flash applications may consist of multiple endpoints that need to communicate. API key propagation varies by endpoint type:

### Completed
- [ ] [Tasks completed so far]
**Load-Balancer (LB) Endpoints:**
- API keys passed via `Authorization: Bearer <token>` header
- Extracted by middleware (`lb_handler.py`)
- Stored in thread-local context (`api_key_context.py`)
- Retrieved for remote calls (`load_balancer_sls.py`)

### In Progress
- [ ] [Current work items]
**Queue-Based (QB) Endpoints:**
- API keys pre-configured as `RUNPOD_API_KEY` environment variable
- Injected during deployment if `makes_remote_calls=True`
- Read from env var for all outgoing remote calls

### Next Steps
- [ ] [Upcoming tasks]
### Manifest-Based Optimization

## Technical Notes
**Pattern:** Skip State Manager queries for local-only endpoints

[Add branch-specific technical details:]
- Architecture decisions made for this branch
- Implementation approaches tried
- Known issues or limitations
- Performance considerations
- Testing strategy
```python
# ServiceRegistry checks if endpoint makes remote calls
self._makes_remote_calls = self._check_makes_remote_calls(resource_name)

## Learnings & Discoveries
# Skip State Manager if local-only
if not self._makes_remote_calls:
logger.debug("Endpoint is local-only, skipping State Manager query")
return
```

[Document insights gained while working on this branch:]
- Unexpected behaviors discovered
- Better approaches found
- Code patterns that worked well
- Areas for future refactoring
**Why:** Reduces API calls and latency for endpoints that don't need remote routing.

## Merge Checklist
### Deployment-Time API Key Injection

Before merging this branch:
- [ ] All tests passing locally (`make quality-check`)
- [ ] Test coverage maintained/improved
- [ ] CLAUDE.md updated in main if patterns changed
- [ ] Documentation updated
- [ ] No merge conflicts with main
- [ ] CI/CD passing
- [ ] Code reviewed
- [ ] Migration plan documented (if needed)
**Pattern:** Inject API key for QB endpoints that make remote calls

## Context for Claude Code
```python
# serverless.py _do_deploy()
if self.type == ServerlessType.QB:
makes_remote_calls = self._check_makes_remote_calls()
if makes_remote_calls and "RUNPOD_API_KEY" not in env_dict:
env_dict["RUNPOD_API_KEY"] = os.getenv("RUNPOD_API_KEY")
```

[Provide context that helps Claude Code assist more effectively:]
- What should Claude know about this branch's goals?
- What patterns or constraints should be followed?
- What areas need special attention?
**Why:** Ensures QB workers can make authenticated calls to other endpoints.

---
### Security Considerations

**Note:** This worktree uses the git worktree workflow. See main CLAUDE.md for shared development patterns and quality requirements.
**Current:**
- API keys stored as plain text env vars
- Injected during deployment (not per-request)
- Requires redeployment for rotation

**Future:** Migrate to RunPod secrets service:
```python
env_dict["RUNPOD_API_KEY"] = {"__secret__": "FLASH_APP_API_KEY"}
```

See [docs/API_Key_Management.md](docs/API_Key_Management.md) for complete documentation.
Loading
Loading