Skip to content

refactor: derive Dummy for ForgeConfig and remove dead code#2732

Merged
tusharmath merged 1 commit intomainfrom
config-dummy-refac
Mar 29, 2026
Merged

refactor: derive Dummy for ForgeConfig and remove dead code#2732
tusharmath merged 1 commit intomainfrom
config-dummy-refac

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Mar 29, 2026

Summary

Replace the manual Dummy implementation for ForgeConfig with a #[derive(Dummy)] macro and remove dead code across domain and provider layers.

Context

ForgeConfig had a large hand-rolled impl Dummy<fake::Faker> block (~50 lines) that manually delegated every field to fake::Faker. This was fragile — any new field added to ForgeConfig required a matching update in the manual impl. The fake crate's derive macro handles this automatically, reducing maintenance burden and keeping the impl in sync with the struct definition by construction.

The PR also takes the opportunity to clean up dead code that had accumulated across the domain (phase field removal, unused stream extensions) and provider response handling layers.

Changes

  • Replaced manual impl Dummy<fake::Faker> for ForgeConfig with #[derive(Dummy)]; only services_url needs a #[dummy(expr = "...")] attribute since it must be a valid URL
  • Removed the phase field from TextMessage and updated all call sites in tests
  • Removed dead code from forge_domain: unused items in message.rs and result_stream_ext.rs
  • Streamlined provider response handling — significant code reduction in bedrock.rs, openai_responses/request.rs, openai_responses/response.rs, and openai_responses/repository.rs
  • Upgraded skill template rendering in skill.rs to use TemplateEngine with proper error propagation instead of raw string replacement
  • Cleaned up provider.json: removed stale model entries, fixed a model ID (anthropic.claude-opus-4-6-v1anthropic.claude-opus-4-6-v1:0), and renamed the minimax URL param from HOSTNAME to MINIMAX_DOMAIN
  • Downgraded async-openai from 0.34.0 to 0.33.1 to drop an unneeded dependency

Testing

cargo insta test --accept

@tusharmath tusharmath changed the title refactor(forge_config): add dummy config generation support refactor: derive Dummy for ForgeConfig and remove dead code Mar 29, 2026
@tusharmath tusharmath merged commit 46c936c into main Mar 29, 2026
14 checks passed
@tusharmath tusharmath deleted the config-dummy-refac branch March 29, 2026 05:55
@tusharmath tusharmath added the type: refactor Code refactoring and restructuring. label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code refactoring and restructuring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant