Skip to content

feat(cloud): 馃 map tool effort onto catalog medium and xhigh - #3

Open
aipal-agent wants to merge 2 commits into
feat/cloud-followup-status-watchfrom
feat/map-grok-effort-catalog
Open

aipal-agent wants to merge 2 commits into
feat/cloud-followup-status-watchfrom
feat/map-grok-effort-catalog

Conversation

@aipal-agent

@aipal-agent aipal-agent commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2

Dependency: #1 on feat/cloud-followup-status-watch.

Outcome

Launch and the models tool speak the live catalog. effort=med is sent as medium when that is the listed value. xhigh is extra high. Omitting fast keeps the model's default. Variant names that would otherwise collide are labeled from their parameters. When the agent record has no model, status reports the source as unknown.

Changes

Tool effort and the wire mapper share one catalog walk. Reply still fails closed when model, effort, or fast is set on a follow-up.

Acceptance

git checkout feat/map-grok-effort-catalog
npm test

Expect 16 files and 52 tests. The launch test sends medium for effort=med. The models tool returns toolEffort and labeled variants.

Boundaries

  • Does not split the package layout.
  • Does not rewrite the published first capsule.
  • Does not add Cloud endpoints or default tools.

Rollback

Revert this pull request. The mapping writes nothing on the host. Existing ledger rows keep the request fields already stored.

Live grok-4.6 catalogs list medium and xhigh, not med. Send the catalog
value, merge the default variant when fast is omitted, and label colliding
variant displayNames from params.

Co-authored-by: AIPAL GROK (4.6) <aipal_grok@uklok.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
@aipal-agent aipal-agent changed the title feat(cloud): 馃 map Grok effort onto Cursor medium and xhigh feat(cloud): 馃 map tool effort onto catalog medium and xhigh Sep 29, 2026
@yonathan9669
yonathan9669 added this pull request to stack #5 September 29, 2026 06:56
Comment thread src/model.ts Outdated
Comment on lines +13 to +40
const EFFORT_ALIASES: Record<EffortLevel, string[]> = {
low: ["low", "minimal", "min"],
med: ["medium", "med", "mid"],
high: ["high"],
xhigh: ["xhigh", "extra_high", "extrahigh", "max"],
};

export function isEffortParamId(id: string): boolean {
const raw = id.trim().toLowerCase();
return raw === "effort" || raw === "thinking" || raw === "reasoning" || raw.endsWith("_effort") || raw.includes("thinking");
}

export function normalizeEffort(value?: string): EffortLevel | undefined {
const raw = value?.trim().toLowerCase();
if (!raw) {
return undefined;
}
if (raw === "low" || raw === "med" || raw === "high") {
if (raw === "low" || raw === "med" || raw === "high" || raw === "xhigh") {
return raw;
}
if (raw === "medium" || raw === "mid") {
return "med";
}
throw new ConfigError(`effort must be low, med, or high (got '${value}')`);
if (raw === "extra_high" || raw === "extrahigh" || raw === "extra-high") {
return "xhigh";
}
throw new ConfigError(`effort must be low, med, high, or xhigh (got '${value}')`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This could be easily rewritten as a mapper which results into a clear own-less principle alignment as the SoT is narrowed from code to data itself, therefore future changes surface is reduced too.

Example:

if (EFFORT_ALIASES[raw] != null) return raw;

const match = Object.entries(EFFORT_ALIASES).find(([effort, aliases]) => 
    aliases.includes(raw)
  )?.[0];

if (match) return match;

throw new ConfigError(`effort must be low, med, high, or xhigh (got '${value}')`);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The alias table is the mapper. A spelling that is already a tool level sits in that level's list, so one lookup covers both the key and the aliases. The schema, the CLI help, and the models payload read that same table. The package split carries the same change.

Input branches, the tool schema, and the models payload were a second copy
of the spellings. The table now maps a spelling to a level and supplies
the preferred catalog value.

Co-authored-by: AIPAL GROK (4.6) <aipal_grok@uklok.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
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