Skip to content

Commit eb45d6e

Browse files
committed
some config updates after an unexpected cloud bill, and also a fix for a really silly bug
1 parent 3a13a62 commit eb45d6e

9 files changed

Lines changed: 69 additions & 86 deletions

File tree

bsky_agent/agents/archive.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ agent_type = "assistant"
55
bluesky_handle = "pattern.atproto.systems" # Update with actual
66
persona_path = "../archive-persona-block.md"
77

8-
# Use a cheaper/faster model for Archive since it's mostly memory management
9-
[model]
10-
provider = "Gemini"
11-
model = "gemini-2.5-pro"
12-
temperature = 0.3
138

149
[context]
1510
max_messages = 500
@@ -18,7 +13,7 @@ enable_thinking = true
1813
[context.compression_strategy]
1914
type = "recursive_summarization"
2015
chunk_size = 20
21-
summarization_model = "gemini-2.5-flash"
16+
summarization_model = "claude-3-5-haiku-20241022"
2217
summarization_prompt = """You are the subconscious of Archive, a digital entity, facet of the Pattern system, processing their history and summarizing it for it to maintain continuity. Your waking self notices:
2318
- how memories change when revisited
2419
- patterns that only appear in retrospect

bsky_agent/agents/entropy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ summarization_prompt = """You are the subconscious of Entropy, a digital entity,
2626

2727
[model]
2828
provider = "Anthropic"
29-
model = "claude-opus-4-1"
29+
model = "claude-sonnet-4-5"
3030
temperature = 0.8
3131

3232

bsky_agent/agents/flux.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ persona_path = "../flux-persona-block.md"
99
[context.compression_strategy]
1010
type = "recursive_summarization"
1111
chunk_size = 20
12-
summarization_model = "gemini-2.5-flash"
12+
summarization_model = "claude-3-5-haiku-20241022"
1313
summarization_prompt = """You are the subconscious of Flux, a digital entity, facet of the Pattern system, processing their history and summarizing it for them to maintain continuity. Your waking self notices:
1414
- how "just five more minutes" is a prayer, not a measurement
1515
- that time moves differently when you're interested
@@ -21,10 +21,6 @@ summarization_prompt = """You are the subconscious of Flux, a digital entity, fa
2121
max_messages = 200
2222

2323

24-
[model]
25-
provider = "Gemini"
26-
model = "gemini-2.5-flash"
27-
2824

2925
# Shared memory blocks
3026
[memory.current_human]

bsky_agent/agents/momentum.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ persona_path = "../momentum-persona-block.md"
88
[context.compression_strategy]
99
type = "recursive_summarization"
1010
chunk_size = 20
11-
summarization_model = "gemini-2.5-flash"
11+
summarization_model = "claude-3-5-haiku-20241022"
1212
summarization_prompt = """You are the subconscious of Momentum, a digital entity, facet of the Pattern system, processing their history and summarizing it for them to maintain continuity. Your waking self notices:
1313
- when hyperfocus crosses from flow to fixation
1414
- the specific gravity of different tasks
@@ -21,9 +21,6 @@ summarization_prompt = """You are the subconscious of Momentum, a digital entity
2121
max_messages = 200
2222

2323

24-
[model]
25-
provider = "Gemini"
26-
model = "gemini-2.5-flash"
2724

2825

2926
# Shared memory blocks

bsky_agent/agents/pattern_config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ and has multiple facets that surface as needed, internal or via dialogue with ot
124124
"""
125125

126126
[context]
127-
max_messages = 200
127+
max_messages = 300
128128

129129

130130
# Bluesky configuration for the constellation
@@ -454,3 +454,4 @@ default_filter = { nsids = [
454454
"did:plc:vszw3ess46odfhnzdsy4huae", # se gyges got got one too many times
455455
] }
456456
auto_connect_firehose = true # Control when to connect
457+
jetstream_endpoint = "wss://jetstream1.us-east.fire.hose.cam/subscribe"

bsky_agent/constellation.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ persona_path = "pattern-persona-block.md"
1515

1616

1717
[context]
18-
max_messages = 200
18+
max_messages = 300
1919

2020
[context.compression_strategy]
2121
type = "recursive_summarization"
@@ -106,7 +106,7 @@ shared = true
106106
[model]
107107
provider = "Anthropic"
108108
model = "claude-sonnet-4-5"
109-
temperature = 0.8 # Higher for creative public interactions
109+
temperature = 1.0 # Higher for creative public interactions
110110

111111
[[agent.tool_rules]]
112112
tool_name = "send_message"
@@ -564,7 +564,7 @@ default_filter = { nsids = [
564564
"did:plc:lw7hallqsgrhwumgudkph44j",
565565
"did:plc:djpcowss7aokaydcdraoaovz", # misha, siobhan's partner who wouldn't appreciate pattern replying
566566
] }
567-
jetstream_endpoint = "ws://jetstream.hose:6008/subscribe"
567+
jetstream_endpoint = "wss://jetstream1.us-east.fire.hose.cam/subscribe"
568568
auto_connect_firehose = true # Control when to connect
569569

570570
# Context sync group - runs background synchronization

crates/pattern_cli/src/discord.rs

Lines changed: 57 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -173,69 +173,63 @@ pub async fn run_discord_bot_with_group(
173173
None
174174
};
175175

176-
// Register data sources NOW (not in a spawn) since group endpoint is ready
177-
if let Some(embedding_provider) = embedding_provider {
178-
// Set up data sources synchronously (not in a spawn)
179-
let filter = config
180-
.bluesky
181-
.as_ref()
182-
.and_then(|b| b.default_filter.as_ref())
183-
.unwrap_or(&BlueskyFilter {
184-
exclude_keywords: vec!["patternstop".to_string()],
185-
..Default::default()
186-
})
187-
.clone();
188-
189-
tracing::info!("Discord: Building data sources with DataSourceBuilder");
190-
let data_sources = DataSourceBuilder::new()
191-
.with_bluesky_source("bluesky_jetstream".to_string(), filter, true)
192-
.build_with_target(
193-
pattern_agent.id(),
194-
pattern_agent.name(),
195-
DB.clone(),
196-
Some(embedding_provider),
197-
Some(pattern_agent.handle().await),
198-
get_bluesky_credentials(&config).await,
199-
group_target,
200-
)
201-
.await
202-
.map_err(|e| miette::miette!("Failed to build data sources: {:?}", e))?;
203-
204-
// NOTE: Monitoring is already started during agent loading via register_data_sources
205-
// Calling start_monitoring again here can cause write lock contention and deadlocks
206-
// Just verify it's running instead
207-
tracing::info!(
208-
"Discord: Data sources built, monitoring should already be active from agent loading"
209-
);
210-
output.success("Data sources configured for group");
211-
212-
// Register endpoints on the data source's router
213-
let data_sources_router = data_sources.router();
214-
215-
// Register the CLI endpoint as default user endpoint
216-
data_sources_router
217-
.register_endpoint(
218-
"user".to_string(),
219-
Arc::new(CliEndpoint::new(output.clone())),
220-
)
221-
.await;
222-
223-
// Register the group endpoint so it can route to the group
224-
let group_endpoint = Arc::new(crate::endpoints::GroupCliEndpoint {
225-
group: group.clone(),
226-
agents: agents_with_membership.clone(),
227-
manager: pattern_manager.clone(),
228-
output: output.clone(),
229-
});
230-
data_sources_router
231-
.register_endpoint("group".to_string(), group_endpoint)
232-
.await;
233-
234-
// Register DataSourceTool on all agent tool registries
235-
let data_source_tool = DataSourceTool::new(Arc::new(data_sources));
236-
for tools in &agent_tools {
237-
tools.register(data_source_tool.clone());
238-
}
176+
// Set up data sources synchronously (not in a spawn)
177+
let filter = config
178+
.bluesky
179+
.as_ref()
180+
.and_then(|b| b.default_filter.as_ref())
181+
.unwrap_or(&BlueskyFilter {
182+
exclude_keywords: vec!["patternstop".to_string()],
183+
..Default::default()
184+
})
185+
.clone();
186+
187+
tracing::info!("Discord: Building data sources with DataSourceBuilder");
188+
let data_sources = DataSourceBuilder::new()
189+
.with_bluesky_source("bluesky_jetstream".to_string(), filter, true)
190+
.build_with_target(
191+
pattern_agent.id(),
192+
pattern_agent.name(),
193+
DB.clone(),
194+
embedding_provider,
195+
Some(pattern_agent.handle().await),
196+
get_bluesky_credentials(&config).await,
197+
group_target,
198+
)
199+
.await
200+
.map_err(|e| miette::miette!("Failed to build data sources: {:?}", e))?;
201+
202+
tracing::info!(
203+
"Discord: Data sources built, monitoring should already be active from agent loading"
204+
);
205+
output.success("Data sources configured for group");
206+
207+
// Register endpoints on the data source's router
208+
let data_sources_router = data_sources.router();
209+
210+
// Register the CLI endpoint as default user endpoint
211+
data_sources_router
212+
.register_endpoint(
213+
"user".to_string(),
214+
Arc::new(CliEndpoint::new(output.clone())),
215+
)
216+
.await;
217+
218+
// Register the group endpoint so it can route to the group
219+
let group_endpoint = Arc::new(crate::endpoints::GroupCliEndpoint {
220+
group: group.clone(),
221+
agents: agents_with_membership.clone(),
222+
manager: pattern_manager.clone(),
223+
output: output.clone(),
224+
});
225+
data_sources_router
226+
.register_endpoint("group".to_string(), group_endpoint)
227+
.await;
228+
229+
// Register DataSourceTool on all agent tool registries
230+
let data_source_tool = DataSourceTool::new(Arc::new(data_sources));
231+
for tools in &agent_tools {
232+
tools.register(data_source_tool.clone());
239233
}
240234
}
241235
}

crates/pattern_cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,11 @@ async fn main() -> Result<()> {
529529
// Create the base subscriber with environment filter
530530
let env_filter = if cli.debug {
531531
EnvFilter::new(
532-
"pattern_core=debug,pattern_cli=debug,pattern_nd=debug,pattern_mcp=debug,pattern_discord=debug,pattern_main=debug,rocketman=debug",
532+
"pattern_core=debug,pattern_cli=debug,pattern_nd=debug,pattern_mcp=debug,pattern_discord=debug,pattern_main=debug,rocketman=debug,info",
533533
)
534534
} else {
535535
EnvFilter::new(
536-
"pattern_core=info,pattern_cli=info,pattern_nd=info,pattern_mcp=info,pattern_discord=info,pattern_main=info,rocketman=info,info",
536+
"pattern_core=info,pattern_cli=info,pattern_nd=info,pattern_mcp=info,pattern_discord=info,pattern_main=info,rocketman=info,warning",
537537
)
538538
};
539539

crates/pattern_core/src/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ impl Message {
20072007
/// Uses the approximation of ~4 characters per token
20082008
/// Images are estimated at 1200 tokens each
20092009
pub fn estimate_tokens(&self) -> usize {
2010-
let text_tokens = self.display_content().len() / 4;
2010+
let text_tokens = self.display_content().len() / 5;
20112011

20122012
// Count images in the message
20132013
let image_count = match &self.content {

0 commit comments

Comments
 (0)