Skip to content

Better constants#37

Merged
ThomasK33 merged 1 commit intocoder:mainfrom
poolsideai:agentcooper/better-constants
May 5, 2026
Merged

Better constants#37
ThomasK33 merged 1 commit intocoder:mainfrom
poolsideai:agentcooper/better-constants

Conversation

@agentcooper
Copy link
Copy Markdown
Contributor

Improve the code generator, so that well-known constants from schema.json become available.

For example, see SessionConfigOptionCategory:

    "SessionConfigOptionCategory": {
      "anyOf": [
        {
          "const": "mode",
          "description": "Session mode selector.",
          "type": "string"
        },
        {
          "const": "model",
          "description": "Model selector.",
          "type": "string"
        },
        {
          "const": "thought_level",
          "description": "Thought/reasoning level selector.",
          "type": "string"
        },
        {
          "description": "Unknown / uncategorized selector.",
          "title": "other",
          "type": "string"
        }
      ],
      "description": "..."
    },

Generated as:

type SessionConfigOptionCategory string

const (
	SessionConfigOptionCategoryMode         SessionConfigOptionCategory = "mode"
	SessionConfigOptionCategoryModel        SessionConfigOptionCategory = "model"
	SessionConfigOptionCategoryThoughtLevel SessionConfigOptionCategory = "thought_level"
)

Copy link
Copy Markdown
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@ThomasK33 ThomasK33 added this pull request to the merge queue May 5, 2026
Merged via the queue into coder:main with commit ea9713a May 5, 2026
1 check passed
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