Skip to content

agent-config: allow specifying local agent config during agent creation#2870

Merged
mschuwalow merged 7 commits intomainfrom
agent-config-worker-creation
Mar 6, 2026
Merged

agent-config: allow specifying local agent config during agent creation#2870
mschuwalow merged 7 commits intomainfrom
agent-config-worker-creation

Conversation

@mschuwalow
Copy link
Contributor

@mschuwalow mschuwalow commented Mar 2, 2026

resolves #2801
resolves #2802

changes look much bigger than they are because of wit / test-component changes

@mschuwalow mschuwalow self-assigned this Mar 2, 2026
@mschuwalow mschuwalow force-pushed the agent-config-worker-creation branch 3 times, most recently from 4176faf to ba326d8 Compare March 3, 2026 15:34
@mschuwalow mschuwalow requested review from afsalthaj and vigoo March 3, 2026 19:16
@mschuwalow mschuwalow force-pushed the agent-config-worker-creation branch from c3b1132 to 1a8877e Compare March 4, 2026 21:08
initial_total_linear_memory_size: u64,
initial_active_plugins: HashSet<PluginPriority>,
config_vars: BTreeMap<String, String>,
local_agent_config: Vec<ParsedWorkerCreationLocalAgentConfigEntry>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be just the raw data? The idea is that all raw oplog entries are as concise as possible (for example invocation parameters also are only Value not ValueAndType etc.) and the public one is the enriched, "render friendly" version. If the enrichment can be done on demand based on metadata and oplog entries, then we can use different types in raw vs public.

Copy link
Contributor Author

@mschuwalow mschuwalow Mar 5, 2026

Choose a reason for hiding this comment

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

Done. We do need the types in the worker status, so this necessitates fetching the component metadata when going from initial oplog entry to the initial worker metadata.

let agent_type = component.metadata
.agent_types()
.iter()
.find(|at| at.type_name == agent_id.agent_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a find_agent_type_by_name or similar helper for this, I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

result
}

pub fn effective_local_agent_config(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move these config-related helpers to a submodule? This file is getting big :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mschuwalow mschuwalow force-pushed the agent-config-worker-creation branch from 1a8877e to 8b5cd3f Compare March 5, 2026 14:54
@mschuwalow mschuwalow requested a review from vigoo March 5, 2026 14:56
@mschuwalow mschuwalow force-pushed the agent-config-worker-creation branch from bc587ba to 1ca9335 Compare March 5, 2026 15:19
@mschuwalow mschuwalow force-pushed the agent-config-worker-creation branch from 1ca9335 to 67d4f38 Compare March 5, 2026 16:11
@mschuwalow mschuwalow merged commit 227bede into main Mar 6, 2026
27 checks passed
@mschuwalow mschuwalow deleted the agent-config-worker-creation branch March 6, 2026 10:46
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

2 participants