Skip to content

feat(agent-config): agent config types, glob matching and cron parsing [3/21] - #324

Open
gusfcarvalho wants to merge 2 commits into
agent-config/02-overlay-primitivesfrom
agent-config/03-types-glob-cron
Open

gusfcarvalho wants to merge 2 commits into
agent-config/02-overlay-primitivesfrom
agent-config/03-types-glob-cron

Conversation

@gusfcarvalho

Copy link
Copy Markdown
Contributor

Part 3 of 21 of the stacked split of #318 (agent remote configuration). Every layer adds the final version of its files from #318, and only imports from layers below it, so each layer passes make reviewable on its own. Nothing is reachable in the app until layer 20 wires the Configuration tab in.

What

The hand-written agent remote-configuration types (src/types/agent-config.ts, re-exported from src/types/agents.ts), glob matching for locked/allowed key patterns, and a 5-field cron parser/describer used for schedule fields.

Tests

Unit specs for glob and cron.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:51
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d9346486-cd27-43dd-b416-b51fe773a873
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Glob and duration validation diverge from server behavior, and the overlay type permits invalid API payloads.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Adds foundational agent remote-configuration types, glob matching, and five-field cron utilities.

Changes:

  • Defines API and configuration document types.
  • Adds Go-compatible glob and cron helpers.
  • Adds unit tests for matching and schedule parsing.
File Description
src/​types/​agent-config.ts Defines remote-configuration types.
src/​types/​agents.ts Re-exports configuration types.
src/​utils/​agent-config/​glob.ts Implements path-style glob matching.
src/​utils/​agent-config/​cron5.ts Validates and describes schedules.
src/​utils/​agent-config/​__tests__/​glob.spec.ts Tests glob behavior.
src/​utils/​agent-config/​__tests__/​cron5.spec.ts Tests cron behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/types/agent-config.ts
Comment on lines +57 to +59
/** JSON Merge Patch (RFC 7396) over ConfigDoc minus the locked keys. `null` deletes. */
export type OverlayDoc = Omit<ConfigDoc, 'api' | 'daemon' | 'remote_config'> &
Record<string, unknown>;
Comment on lines +132 to +135
const d = expr.slice('@every '.length);
return GO_DURATION_RE.test(d)
? null
: `invalid duration "${d}" in @every`;
Comment on lines +131 to +132
let pat: Runes = Array.from(pattern);
let nm: Runes = Array.from(name);
gusfcarvalho and others added 2 commits October 6, 2026 06:20
Layer 3 of 21 in the stacked split of #318.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Go's time.LoadLocation reads zoneinfo files by name, case-sensitively on
the agent's host; Intl matches case-insensitively, so cron5 accepted
TZ=utc and CRON_TZ=europe/london, which the API and agent reject.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/03-types-glob-cron branch from 0362bb9 to 6cc9c63 Compare October 6, 2026 09:40
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