feat: add environment-based agent weight system#6
Merged
Conversation
- Detect CLAUDECODE (truthy) to increase claude-code weight - Detect CODEX_SANDBOX (exists) to increase codex weight - Weights stored in JIXOFLOW_*_WEIGHT env vars for subprocess inheritance - Default profile order determined by weights (higher = priority) - User config completely overrides weight-based ordering This enables fair default ordering based on the current Agent environment, supporting nested Agent scenarios where child processes inherit parent preferences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a fair default ordering system for AI agents based on the current execution environment.
Problem
Previously,
claude-codewas hardcoded as the first priority, which wasn't fair when running in a Codex environment.Solution
Detect the current Agent environment and adjust weights accordingly:
CLAUDECODEJIXOFLOW_CLAUDECODE_WEIGHT += 1CODEX_SANDBOXJIXOFLOW_CODEX_WEIGHT += 1Behavior Examples
User Config Priority
User's explicit
.default()configuration completely overrides weight-based ordering.Tests
Added 10 new test cases for the weight system (90 total tests passing).